Other Resources:
Positive look-ahead assertion (?=...)
What is a positive look-ahead assertion? How to use it?
How to write a regular expression to find words with 'oo' in text like: how, to, look, google, school?
✍: FYIcenter.com
A positive look-ahead assertion is a zero-width assertion that allows you to 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+(?=\t) - matches a word followed by a tab without tab in the match
The regular expression to match find words with 'oo' is:
*(?=\w*oo)(\w+)
* - skip space characters
(?=\w*oo) - any word with '00' ahead?
(\w+) - capture the word
2013-01-26, 0👍, 0💬
Popular Posts:
How to write a regular expression to parse key-value entries from Windows .INI files? Here is an exa...
According to the IEEE 802 specification, a MAC address has 6 groups of 2 hexadecimal digits separate...
How to capture the Soso Spider entries from Web log file? Here are some Web log file entries: 127.0....
All credit card numbers issued by Diners Club must start with 300 through 305, 36 or 38 and have 14 ...
All credit card numbers issued by Diners Club must start with 300 through 305, 36 or 38 and have 14 ...