Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regular Expression to find sequences of lowercase letters joined with underscore

Tags:

regex

I can't seem to make my regular expression work.

I'd like to have some alpha text, no numbers, an underscore and then some more aplha text.

for example: blah_blah

I have an non-working example here

^[a-z][_][a-z]$

Thanks in advance people.

EDIT: I apologize, I'd like to enforce the use of all lower case.

like image 986
user104628 Avatar asked May 26 '10 07:05

user104628


1 Answers

^[a-z]+_[a-z]+$
like image 106
Marco Avatar answered Oct 06 '22 00:10

Marco