Practical Unix: Regular Expressions 5 - Lookarounds
Channel: Sam King
Date: 2013-12-14

0:00 setting up the example
0:47 lookarounds
foo(?=bar) is a positive lookahead that will match the foo in foobar but not foobaz.
foo(?!bar) is a negative lookahead that will match the foo in foobaz but not foobar.
(?CHANGE=bar)foo is a positive lookbehind that will match the foo in barfoo but not bazfoo.
(?CHANGE!bar)foo is a negative lookbehind that will match the foo in bazfoo but not barfoo.

NOTE:  the less than sign is not allowed in YouTube descriptions, so I put a "CHANGE" in the lookbehinds instead of it.