[{"data":1,"prerenderedAt":101},["ShallowReactive",2],{"tool-guide:regex-tester":3},{"overview":4,"whatIs":5,"useCases":6,"steps":12,"commonMistakes":18,"relatedStandards":24,"comparison":37,"example":78,"limitations":82,"faq":85},"Regex Tester runs JavaScript regular expressions in an isolated worker and presents bounded matches and capture groups without executing user-supplied code.","A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Regular expressions are used in virtually every programming language and text editor to find, match, replace, and validate strings. They range from simple literal patterns (find every occurrence of \"error\") to complex constructions with quantifiers, character classes, groups, lookahead, and lookbehind assertions. The JavaScript regex engine supports named capture groups, Unicode property escapes, and the v flag for set operations in character classes. A regex tester lets you develop and debug patterns interactively: type a pattern, paste test text, and instantly see which parts match and what each capture group contains. This feedback loop is essential because regex syntax is dense and a single misplaced quantifier can change the meaning entirely. StackCache runs the pattern in an isolated Web Worker with a time limit, so even a pattern with catastrophic backtracking is safely cancelled instead of freezing your browser tab.",[7,8,9,10,11],"Validating user input — build and test patterns for email addresses, phone numbers, postal codes, or custom identifiers before embedding them in your application.","Parsing log files — write patterns to extract timestamps, error codes, IP addresses, or request IDs from unstructured log lines.","Search-and-replace refactoring — prototype a pattern with capture groups before using it in a global find-and-replace across your codebase.","Writing data extraction pipelines — test patterns that pull structured data from HTML, CSV, or plain text before committing them to a scraping or ETL script.","Learning regex — experiment with metacharacters, quantifiers, and assertions with immediate visual feedback on what matches and what does not.",[13,14,15,16,17],"Enter a regex pattern in the pattern field. Use JavaScript syntax (e.g. \\d+, [A-Za-z], (?\u003Cname>...)).","Set flags: g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode), or v (unicode sets).","Paste or type test text in the input area.","Matches are highlighted in the test text as you type. Each match shows its index, full text, and named or numbered capture groups.","If the pattern causes catastrophic backtracking, the worker is cancelled after the time limit and a timeout warning is shown.",[19,20,21,22,23],"Forgetting to escape special characters — characters like . * + ? ( ) [ ] { } ^ $ \\ | have special meaning. To match them literally, escape with a backslash: \\. \\* \\+.","Greedy vs lazy quantifiers — .* is greedy and matches as much as possible. Use .*? for the shortest match. This matters especially when matching HTML tags or quoted strings.","Catastrophic backtracking — nested quantifiers like (a+)+ or (a|aa)* can cause exponential matching time on certain inputs. Rewrite with atomic groups or possessive quantifiers.","Anchoring patterns — without ^ and $ (or \\b for word boundaries), a pattern matches anywhere in the string. If you need a full-string match, anchor both ends.","Overlooking the global flag — without g, only the first match is returned. Use g to find all matches, but be aware that lastIndex advances between calls to exec().",[25,28,31,34],{"title":26,"url":27},"ECMAScript RegExp specification","https:\u002F\u002Ftc39.es\u002Fecma262\u002Fmultipage\u002Ftext-processing.html#sec-regexp-regular-expression-objects",{"title":29,"url":30},"MDN — Regular Expressions guide","https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FGuide\u002FRegular_expressions",{"title":32,"url":33},"MDN — RegExp reference","https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FGlobal_Objects\u002FRegExp",{"title":35,"url":36},"Unicode Technical Standard #18 — Unicode Regular Expressions","https:\u002F\u002Funicode.org\u002Freports\u002Ftr18\u002F",{"heading":38,"columns":39,"rows":44},"Regex flavors across languages",[40,41,42,43],"JavaScript","Python","Go","PCRE (PHP\u002FPerl)",[45,52,57,64,69,74],{"label":46,"values":47},"Named groups",[48,49,50,51],"(?\u003Cname>)","(?P\u003Cname>)","Not supported","(?P\u003Cname>) or (?\u003Cname>)",{"label":53,"values":54},"Lookbehind",[55,55,50,56],"Variable-length","Fixed-length only",{"label":58,"values":59},"Unicode properties",[60,61,62,63],"\\p{L} (u\u002Fv flag)","\\p{L} (default)","Limited","\\p{L}",{"label":65,"values":66},"Atomic groups",[67,67,50,68],"Not yet","(?>...)",{"label":70,"values":71},"Multiline default",[72,73,73,73],"^ $ match start\u002Fend",". excludes \\n",{"label":75,"values":76},"Set operations",[77,50,50,50],"v flag ([A--B])",{"label":79,"input":80,"output":81},"Capture a service identifier","Pattern: service-(?\u003Cid>\\d+)\nText: service-204 is ready","Match: service-204\nGroup id: 204",[83,84],"Syntax and behavior follow the browser JavaScript regular-expression engine.","Execution is bounded and may time out for pathological patterns.",[86,89,92,95,98],{"question":87,"answer":88},"Which regex engine does this tester use?","It uses the JavaScript RegExp engine built into your browser, which supports named capture groups, lookahead, lookbehind, and Unicode property escapes.",{"question":90,"answer":91},"Does the tool execute my code?","No. Only the regular expression is compiled and matched against your test text. No arbitrary JavaScript runs.",{"question":93,"answer":94},"What happens with catastrophic backtracking?","The evaluation runs in an isolated worker with a time limit. If a pattern takes too long, execution is cancelled and a timeout is reported.",{"question":96,"answer":97},"Can I use this tool to test regex for Python or Go?","The core syntax (character classes, quantifiers, groups) is similar across languages, but named group syntax, lookbehind support, and flag behavior differ. Test the final pattern in your target language.",{"question":99,"answer":100},"What are the regex flags?","g (global, find all matches), i (case-insensitive), m (multiline, ^ and $ match line boundaries), s (dotall, . matches newlines), u (Unicode, enables \\p{} escapes), and v (Unicode sets, enables set operations in character classes).",1788868140632]