Егор Лебедев Егор Лебедев - 4 months ago 17
PHP Question

regex check string in camel case without non-character symbols

I got

^[a-z]+([A-Z]?[a-z]+)+
regex to check camel case, how to make it also check that there is no non-character symbols in string?

Answer

Use $ at the end of your expression:

^[a-z]+([A-Z]?[a-z]+)+$
Comments