dimanche 1 mars 2015

simple symbol regex solution

The problem I'm looking at says only inputs with '+' symbols covering any letters in the string is true so like "+d++" or "+d+==+a+" but not



"f++d+"
"3+a=+b+"
"++d+=c+"


I tried to solve this using regex since it's kind of a string pattern matching problem. /(+[a-z][^+])|([^+.][a-z]+)/ but this does not cover patterns where the letters are at the beginning or end of the string. I need help something more comprehensive. I'm new to using regex so plz help


Aucun commentaire:

Enregistrer un commentaire