regex - Regular expression for word that not starts with dot -


i need create regular expression word not starting dot , may contains alphabet,space , dot.

ex: sample,sample.test,sample test

regular expression should not allow .sample,sample.,sample .test

how generate regular expression this?

this regex: ^[^.][\p{l} .]+$ should match after.

the ^ anchor instruct regex engine start matching beginning of string. [^.] match 1 character not period (.). [\p{l} .]+ match 1 ore more characters either letter (in language shown here), white space or period. finally, $ instruct regex terminate matching @ end of string.

edit: per comment question, should testable: ^[^.][a-za-z .]+$.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -