Free · Fast · Privacy-first

Regex Lookahead and Lookbehind Tester

Lookahead and lookbehind are some of the most powerful — and misunderstood — features in regex. They let you match content based on surrounding context without consuming those surrounding characters. FixTools lets you test all four lookaround types with live highlighting so you can see exactly what is and is not matched.

Cost
Free forever
Sign-up
Not required
Processing
In your browser
Privacy
Files stay local

Test positive and negative lookaheads live

🔒

Test positive and negative lookbehinds live

Zero-width assertions shown in match highlights

Developer Tool

Regex Tester

All processing happens in your browser — your files are never uploaded to any server.

🚀Open Regex Tester

100% Free · No account · Works on any device

How to use this tool

💡

Try a positive lookahead: \d+(?= dollars) matches the number in "100 dollars" but not in "100 euros". Paste this pattern and test string to see how lookahead works in practice.

How It Works

Step-by-step guide to regex lookahead and lookbehind tester:

  1. 1

    Understand the four lookaround types

    (?=...) positive lookahead: match if followed by pattern. (?!...) negative lookahead: match if NOT followed by pattern. (?<=...) positive lookbehind: match if preceded by pattern. (?<!...) negative lookbehind: match if NOT preceded by pattern.

  2. 2

    Test a positive lookahead

    Pattern: \w+(?=\s+Street) — test string: "Baker Street, Elm Avenue, Oak Street". Matches "Baker" and "Oak" but not "Elm".

  3. 3

    Test a negative lookahead

    Pattern: \d+(?! dollars) — test string: "100 euros, 50 dollars, 200 pounds". Matches "100" (followed by euros) and "200" (followed by pounds) but not "50" (followed by dollars).

  4. 4

    Test a lookbehind

    Pattern: (?<=\$)\d+ — test string: "$100 and £200". Matches "100" (preceded by $) but not "200" (preceded by £).

  5. 5

    Combine lookarounds

    Lookaheads and lookbehinds can be combined: (?<=\$)\d+(?=\.\d{2}) matches the integer part of a dollar amount only when followed by decimal cents.

Frequently asked questions

6 questions

Related guides

More use-case guides for the same tool:

Ready to get started?

Open the full Regex Tester — free, no account needed, works on any device.

Open Regex Tester

Free · No account needed · Works on any device