lookaround - Regex lookahead, lookbehind and atomic groups - Stack Overflow

PHOTO EMBED

Fri Oct 16 2020 18:35:36 GMT+0000 (Coordinated Universal Time)

Saved by @saisandeepvaddi

bar(?=bar)     finds the 1st bar ("bar" which has "bar" after it)
bar(?!bar)     finds the 2nd bar ("bar" which does not have "bar" after it)
(?<=foo)bar    finds the 1st bar ("bar" which has "foo" before it)
(?<!foo)bar    finds the 2nd bar ("bar" which does not have "foo" before it)
content_copyCOPY

https://stackoverflow.com/questions/2973436/regex-lookahead-lookbehind-and-atomic-groups