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.
Test positive and negative lookaheads live
Test positive and negative lookbehinds live
Zero-width assertions shown in match highlights
Developer Tool
All processing happens in your browser — your files are never uploaded to any server.
🚀Open Regex Tester100% Free · No account · Works on any device
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.
Step-by-step guide to regex lookahead and lookbehind tester:
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.
Test a positive lookahead
Pattern: \w+(?=\s+Street) — test string: "Baker Street, Elm Avenue, Oak Street". Matches "Baker" and "Oak" but not "Elm".
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).
Test a lookbehind
Pattern: (?<=\$)\d+ — test string: "$100 and £200". Matches "100" (preceded by $) but not "200" (preceded by £).
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.
More use-case guides for the same tool:
Open the full Regex Tester — free, no account needed, works on any device.
Open Regex Tester →Free · No account needed · Works on any device