x11joex11
Jan 27th 2008, 8:30 pm
I have a question, I am trying to write a RegEX to match only characters that are 1-5 characters in length not 6 and characters greater then 6.
So for example,
hey - ok
there- ok
muscle - bad (6 characters)
crazy - ok
morethensix - ok (above 6 so still good)
I can write a regEX that does the reverse and only matches '6' characters and it looks like this
^.{6}$
If anyone can help let me know, much appreciated! (I'm probably just being stupid and missing something easy).
Note** (It must be only a regEX code, you can't change the PHP code to say !pregmatch, it has to do with the custom client system that is in place that is designed to work with positive matches and not negative)
Best,
- Joe
So for example,
hey - ok
there- ok
muscle - bad (6 characters)
crazy - ok
morethensix - ok (above 6 so still good)
I can write a regEX that does the reverse and only matches '6' characters and it looks like this
^.{6}$
If anyone can help let me know, much appreciated! (I'm probably just being stupid and missing something easy).
Note** (It must be only a regEX code, you can't change the PHP code to say !pregmatch, it has to do with the custom client system that is in place that is designed to work with positive matches and not negative)
Best,
- Joe