Any valid regular expression can be used inside the lookahead. It helps me open my mind about regex. The positive lookahead construct is a pair of parentheses, with the opening parenthesis followed by a question mark and an equals sign. Because the lookahead is negative, this means that the lookahead has successfully matched at the current position. While Perl requires alternatives inside lookbehind to have the same length, PCRE allows alternatives of variable length. Lookbehind is similar, but it looks behind. Personally, I find the lookbehind easier to understand. I love the way you present. Thanks a lot, Lookahead Example: Simple Password Validation, The Order of Lookaheads Doesn't Matter… Almost, Positioning the Lookaround Before or After the Characters to be Matched, Lookarounds that Look on Both Sides: Back to the Future, Compound Lookahead and Compound Lookbehind, The Engine Doesn't Backtrack into Lookarounds (They're Atomic), Fixed-Width, Constrained-Width and Infinite-Width Lookbehind, Lookarounds (Usually) Want to be Anchored, lazy quantifier requires backtracking at each step, obnoxious double-negative character range, Lookbehind: Fixed-Width / Constrained Width / Infinite Width, Asserts that what immediately follows the current position in the string is, Asserts that what immediately precedes the current position in the string is, Asserts that what immediately follows the current position in the string is not, Asserts that what immediately precedes the current position in the string is not. Many regex flavors, including those used by Perl, Python, and Boost only allow fixed-length strings. We certainly can do that as easy as adding this other pattern to the one we are looking for I really like the way you explain in this website. (?