Re: Regular expression for word counting

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



* drasko wrote, On 14-7-2007 22:19:
Doesn't work... :(


The regex I sent does not allow for multiple whitespace characters right after eachother.

Altering it to:

^(\S+\s+){0,49}\S+$

should work, but that counts up to 49 gaps, not up to 49 exact whitespace characters.

If you want to be more exact I suggest you sue a custom validator and write the javascript and server side logic yourself using the normal String functions.

Jesse
.


Quantcast