Converemon
New Member
- Joined
- May 23, 2014
- Messages
- 15
I need help generating a regular expression that does not match a certain form of string. The string can be:
-K09+M72+L86+B12 . . .
Or even K09 + M72 +L86 + B12
But cannot be:
-K098+M72+L86+B12
-kshbd+M72+L86+B12
-K98+M72+Ldsjfjhb86+B12
-etc.
Right now I have ^(?!.*^\s*[A-Z][0-9][0-9]\s*(\+\s*[A-Z][0-9][0-9]\s*)*$ as my expression which does seem to work very well with what I'm trying to do. Again I am trying to match strings that do not comply with the standards (i.e. the second group). I hope a fresh pair of eyes can put out what I'm doing wrong.
[TABLE="width: 341"]
<TBODY>[TR]
[TD="align: left"]
[TABLE="width: 341"]
<TBODY>[TR]
[TD="align: left"]</SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]
</SPAN>[/TD]
[/TR]
</TBODY>[/TABLE]
-K09+M72+L86+B12 . . .
Or even K09 + M72 +L86 + B12
But cannot be:
-K098+M72+L86+B12
-kshbd+M72+L86+B12
-K98+M72+Ldsjfjhb86+B12
-etc.
Right now I have ^(?!.*^\s*[A-Z][0-9][0-9]\s*(\+\s*[A-Z][0-9][0-9]\s*)*$ as my expression which does seem to work very well with what I'm trying to do. Again I am trying to match strings that do not comply with the standards (i.e. the second group). I hope a fresh pair of eyes can put out what I'm doing wrong.
[TABLE="width: 341"]
<TBODY>[TR]
[TD="align: left"]
[TABLE="width: 341"]
<TBODY>[TR]
[TD="align: left"]</SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]
</SPAN>[/TD]
[/TR]
</TBODY>[/TABLE]