Question : Regex for number and string

Hi,
My new question is built on this:

http://www.experts-exchange.com/Programming/Languages/Regular_Expressions/Q_26305254.html

Now I want to know what is the solution if I only want at most two words between the number and the string "offer", and no wired characters are allowed within the two words.

For example, "120 offers", "120 nice offers", and "120 very nice offers" are acceptable, but  "120 very very nice offers" or  "120 %$^3  offers" is not acceptable.

Thanks.

Answer : Regex for number and string

If you want to allow extra spaces between words, insert a + after each space in the pattern.
If you want to allow tabs in place of spaces, replace each space with [ \t] (or with \s, if you're certain that other forms of white space cannot be present).

Random Solutions  
 
programming4us programming4us