I need to strip a URL for routing. For that matter the parameters must be checked and redirected accordingly.
The is a need of a regular expression that will check if the parameter is a word(s)(white spaces allowed), or a number (integer – between 1-100).
I know how to get the number.. and the words.. I don’t know how to check that it is ONLY one of them, examples bellow.
thanks
1 // a match
22 // a match
22a // not a match
abc // a match
abc def g // a match
ab33 // not a match
You can use this pattern.