Regex State Machine Visualizer - Online DFA Diagram
Enter a simple regular expression and see its equivalent Deterministic Finite Automaton diagram. Learn how regex engines work.
UD5 Toolkit
Experiment with lookahead & lookbehind assertions in real-time
(?=...) (?!...) (?<=...) (?<!...) — Zero-width assertions that check context without consuming characters
| # | Match | Position | Length | Capture Groups |
|---|---|---|---|---|
| No matches yet. Try adjusting your regex or test text. | ||||
Enter a regex with lookaround assertions to see an automatic breakdown of each lookaround component.
A lookahead (?=...) checks if the text after the current position matches a pattern, without consuming characters. It's a zero-width assertion—it inspects but doesn't "eat" the text. Negative lookahead (?!...) ensures the pattern does not follow.
A lookbehind (?<=...) checks if the text before the current position matches a pattern, without consuming characters. Negative lookbehind (?<!...) ensures the pattern does not precede. Supported in ES2018+ (Chrome 62+, Firefox 78+, Safari 16.4+).
Because lookaround assertions match a position in the text, not actual characters. They don't add to the match length—they simply check a condition at that spot. The regex engine "looks around" without moving its cursor.
Yes! Groups inside lookarounds can capture text. For example, (?=(foo)\d+) will capture "foo" in group 1 even though the lookahead itself doesn't consume characters. This is useful for extracting context-dependent data.
Password validation (must contain digit, uppercase, symbol), string extraction (get text between delimiters), find & replace (match only when surrounded by specific context), and text parsing where context matters but shouldn't be part of the match.
Lookbehind was added in ES2018. It's supported in Chrome 62+, Edge 79+, Firefox 78+, Node.js 8.10+, and Safari 16.4+. Older browsers (especially Safari < 16.4) will throw a SyntaxError. Always test with your target browsers.
Yes, you can nest lookarounds inside each other. For example: (?=(?=.*\d).{8,}). However, deeply nested lookarounds can become hard to read and debug. Use this tool to experiment and understand how they interact!
Enter a simple regular expression and see its equivalent Deterministic Finite Automaton diagram. Learn how regex engines work.
Enter a regular expression and see a visual railroad diagram explaining the pattern. Learn and debug regex.
Check English spelling and get suggestions using the browser's built-in dictionary. Highlight errors instantly. No data leaves your machine.
Test different line‑break and word‑break values on Chinese/Japanese/Korean text. See how browsers wrap. Essential for i18n.
Test how non‑Latin characters (Chinese, Cyrillic, Arabic) convert to URL‑safe slugs with proper transliteration rules. Preview the final string.
Convert any text into JavaScript‑style \uXXXX escape sequences and vice versa. Handles emojis. Useful for i18n development.
Upload a text file to detect its character encoding (UTF-8, ISO-8859-1, etc.) and BOM presence. Runs entirely in your browser.
Paste text and instantly see if it contains hidden zero‑width characters often used in steganography. Reveal invisible payloads.
See how a full paragraph looks with your chosen text and background colors. Not just a ratio; the real appearance.
Paste rich text and clean it to plain text. Normalize line endings and whitespace. Prepare for code or databases.
Paste two texts and see cosine and Jaccard similarity scores. Understand how close two documents are. All local math.
Enter a URL and a user‑agent to see if it is allowed or blocked by the robots.txt file. Quick bot validation.
Paste two versions of the same idea and see a word‑level diff highlighting the rewrite. Not AI, just diff.
Paste your JSON‑LD or Microdata and test it against Google's Rich Results criteria. Get warnings. Local linter.
Identify common grammar mistakes (subject-verb agreement, tense, articles) with simple rule-based analysis. Explanations provided. Not AI, purely rule-based and local.
Paste two strings that look the same and see if they differ after normalization. Debug invisible encoding bugs.
Paste your Accept‑Language header and see which languages your site should serve based on quality values. Internationalization helper.
Test overscroll‑behavior: contain to prevent background scroll or pull‑to‑refresh. See the effect in a live demo.
Search a complete list of all top‑level domains. See which still have availability. For brand naming. Static reference.
Check and beautify your TOML config files. Highlights errors and aligns tables and arrays. Safe local parsing.
Search by MIME or file extension to see the corresponding type. Helpful when configuring web servers. Static.
Paste a string and get a clean, safe file name by replacing forbidden characters. Works for Windows, Mac, Linux.
Check if your site is cross‑origin isolated by examining the COOP and COEP headers. See if SharedArrayBuffer is available.
Simulate reduced motion preference and test your animations. Copy the media query snippet. Keep your users safe.
Apply dyslexia‑friendly fonts, spacing, and background to any text. Preview and copy the formatted version. Improve readability.
Paste text and detect its language (70+ languages) using a simple character n-gram model implemented in JavaScript. No server communication.
Create seamless CSS background patterns like stripes, polka dots, checkerboard. Adjust size and colors. Copy the tiny CSS.
Paste raw email headers and get a human-readable breakdown of the delivery route, authentication results, and delays. Private analysis.
Simulate forced‑colors mode and see how your site looks. Adjust CSS system colors. Make your design accessible.
Paste a `Set‑Cookie` header and see all attributes parsed: domain, path, Max‑Age, SameSite, Secure, HttpOnly. Debug cookies easily.