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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -