Skip to content

Instantly share code, notes, and snippets.

@edinsoncs
Created January 27, 2016 05:06
Show Gist options
  • Save edinsoncs/3799ac3311189728e6b2 to your computer and use it in GitHub Desktop.
Save edinsoncs/3799ac3311189728e6b2 to your computer and use it in GitHub Desktop.
match
function toMatch(string) {
var eString = string;
var toExpression = /[A-Z]/gi;
var result;
var match = eString.match(toExpression);
var i = 0;
while(i < match.length) {
console.log(i);
i++;
if(match.length <= 28) {
var t = match.search('a');
result = t;
console.log(result)
}
else {
console.log('a');
}
}
return match
}
toMatch('hola mi nombre es edinson carranza');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment