Advanced Patterns: Positive Lookahead

The Regex Wizard has spoken!

A look-ahead for the bold and the brave, the positive lookahead is not for the faint of heart.

The positive lookahead is a powerful tool for predicting the future, but be warned: it's like trying to predict the stock market, except less accurate.

Here's a sample regex that demonstrates its use:

(?=pattern)(?positive lookahead)

A simple regex that says "if pattern, then look for this other pattern too, but only if you're feeling confident about it."

But don't just take our word for it, try it out yourself:

Try it out!

Try it out!