How do I write a regular expression that will match all words starting with I
except the word Integer
?
Example:
t1: Integer;
t2: Interface;
t3: IXml;
The result should be Interface
and IXml
.
How do I write a regular expression that will match all words starting with I
except the word Integer
?
Example:
t1: Integer;
t2: Interface;
t3: IXml;
The result should be Interface
and IXml
.
If you can’t use a look-ahead assertion as SilentGhost suggested, you can express the same using basic regular expression syntax:
I(\b|[A-Za-mo-z][A-Za-z]*|n(\b|[A-Za-su-z][A-Za-z]*|t(\b|[A-Za-df-z][A-Za-z]*|e(\b|[A-Za-fh-z][A-Za-z]*|g(\b|[A-Za-df-z][A-Za-z]*|e(\b|[A-Za-qs-z][A-Za-z]*|r[A-Za-z]+))))))