{"version":"2.1.315","anchor":"regex-parser-rewritten-with-lookahead-counted-repeats-and-f","canonical_anchor":"regex-parser-rewritten-with-lookahead-counted-repeats-and-f","heading":"Claude Code's pattern parser now understands more regular expression features","tier":"internal","area":"Elsewhere","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.315\/e\/regex-parser-rewritten-with-lookahead-counted-repeats-and-f","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.315","markdown":"### Claude Code's pattern parser now understands more regular expression features\n\nClaude Code's regular expression parser now handles counted repeats, lookahead and named groups, and gives a reason when it refuses a pattern\n\n**Unclear.** Where Claude Code uses this parser, and so which patterns a user writes are affected, is not stated.\n\n**What**\n\nClaude Code has its own parser for regular expressions, which are text patterns used to match strings. It was rewritten. It now understands:\n\n- Counted repeats such as `{n,m}`\n\n- Lookahead groups anywhere in the pattern, not only at the start\n\n- Named groups\n\nBefore, it handled only the `*`, `+` and `?` repeats and a lookahead at the very start of a pattern.\n\nWhen it cannot handle a pattern, it now gives a specific reason, such as a lookbehind, a back-reference, a flags group, older pattern syntax, or a pattern that is too large.\n\n**Why**\n\nPatterns that use these features can now be read where they could not before, and a refused pattern now comes with a reason.\n\n- Area: Elsewhere\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}