Regex with phrase, space and any digit -


i'm not experienced regular expressions, need 1 allows specific phrase, space, digit , dot in order.

like this:

theme 1. question 15.  

and on.

thanks

you can use regex :

^[a-za-z]+\s\d+\.$ 

meaning

^            ->  start of phrase [a-za-z]+    ->  specific phrase allow 1 or more upper or lower alphabets \s           ->  followed space \d+          ->  followed 1 or more degits \.           ->  end dot $            ->  end of phrase 

regex demo


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -