Other Resources:
Negative look-ahead assertion (?!...)
What is a negative look-ahead assertion? How to use it?
How to write a regular expression to find words without 'oo' in text like: how, to, look, google, school?
✍: FYIcenter.com
A negative look-ahead assertion is a zero-width assertion that allows you to not match a subpattern beyond the current position (look-ahead) without moving the matching position. Positive look-ahead assertion is expressed as (?!pattern). For example:
\w+(?!-) - matches a word not followed by a '-'
The regular expression to match find words without 'oo' is:
+(?!\w*oo)(\w+)
+ - skip space characters
(?!\w*oo) - any word without '00' ahead?
(\w+) - capture the word
2013-01-26, 0👍, 0💬
Popular Posts:
A free online regular expression test tool that allows to try you regular expression pattern and see...
All credit card numbers issued by Diners Club must start with 300 through 305, 36 or 38 and have 14 ...
How to capture the MSN (Microsoft Network) bot entries from Web log file? Here are some Web log file...
A free online regular expression test tool that allows to try you regular expression pattern and see...
How to write a regular expression to validate GUID (Globally Unique IDentifier) or UUID (Universally...