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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -