The solution chosen by the Perl developers was to use ``(?...)`` as the extension syntax.``?`` immediately after a parenthesis was a syntax error because the ``?`` would have nothing to repeat, so this didn't introduce any compatibility problems.The characters immediately after the ``?``indicate what extension is being used, so ``(?=foo)`` is one thing (a positive lookahead assertion) and ``(?:foo)`` is something else (a non-capturing group containing the subexpression ``foo``).