← Chrome 160 reference · All APIs
v160 · javascript · covered on mdn
Regular Expression Buffer Boundaries
Chrome 160 enables the TC39 Stage 3 RegExp buffer boundary assertions \A, \z, and \Z in Unicode-mode (u or v flag) regular expressions. They match the start of the entire input, the exact end of the input, and the end of the input before an optional trailing line terminator sequence, regardless of whether the m (multiline) flag is set.
this feature is documented on MDN
\A, \z, \Z
MDN’s dedicated page (verified HTTP 200 on 2026-11-24) covers formal syntax, semantics for \A, \z, and \Z, worked examples (mixing \A with multiline ^ and matching end-of-file with optional trailing newline via \Z), Specifications, and BCD-backed Browser compatibility. gendn links there rather than duplicating canonical MDN reference prose.
Why gendn doesn’t duplicate MDN: this site fills gaps for Chrome features lacking an MDN article. When MDN already publishes a complete reference, gendn points to MDN and records the Chrome 160 shipping metadata, V8 flag, Annex B compatibility caveat, and interactive showcase demo that MDN does not track.
Chrome 160 details & Unicode-mode requirement
In Unicode-aware mode (u or v flag), the TC39 proposal specification defines three zero-width Assertion escapes equivalent to RegExp modifier expressions:
\A— synonym for(?-m:^): matches only at index 0 of the input string, even under/m.\z— synonym for(?-m:$): matches only at the exact end of the input string, even under/m.\Z— synonym for(?=(?:\r\n|\n|\r|\u2028|\u2029)?(?-m:$)): matches at the end of the input string or immediately before a single trailing line terminator (including\r\n).
Annex B trap outside u/v mode: Without the u or v flag, ECMA-262 Annex B parses \A, \z, and \Z as legacy identity escapes matching the literal characters "A", "z", and "Z" without throwing a SyntaxError. None of the three escapes are valid inside a character class ([\A] throws a SyntaxError under u/v).
// Feature detection: Unicode-mode compilation throws SyntaxError on unsupported engines.
function supportsRegExpBufferBoundaries() {
try {
return new RegExp("\\Aok\\Z", "u").test("ok\r\n");
} catch {
return false;
}
}
// Mix buffer-start (\A) with line-start (^) under /mu:
const re = /\A#!.*|^\s*\/\/.*/gmu;
re.exec("#!/usr/bin/env node\n // comment"); // matches hashbang at start of buffer, then line comments
// Caution: omitting `u` or `v` silently falls back to Annex B identity escapes!
/\A/.test("A"); // true (matches literal "A", NOT start of input)
Source: TC39 Regular Expression Buffer Boundaries Stage 3 Draft; proposal README; ChromeStatus 5187917373898752.
live example
\A, \z, and \Z across multiline inputs. Sibling concept demos (all HEAD 200): assertion position map, Annex B literal trap, multiline validation bypass, and portable pattern import.Source: chrome-platform-showcaseBrowser compatibility
| Browser / Runtime | Status | Notes & BCD status |
|---|---|---|
| Chrome (desktop, Android, WebView) | 160 | Enabled by default in Chrome 160 per milestone=160 listing and ChromeStatus API record; BCD still reads false (not yet updated) |
| Edge | 160 (mirror) | Chromium-based; BCD mirrors Chrome |
| Firefox | Preview (155.0a1) | ChromeStatus links Firefox 155.0a1 Nightly release notes; BCD lists preview behind preference javascript.options.experimental.regexp_buffer_boundaries |
| Safari | Preview | BCD lists preview; ChromeStatus records Safari signal as “No signal” and no stable release number is confirmed yet |
| Node.js / Deno / Bun | Unsupported (BCD) | BCD lists false across Node.js, Deno, and Bun as of 2026-11-24 (Node.js inherits support once updated to a V8 release containing Chrome 160’s V8) |
quick reference
| Shipped in | Chrome 160 (desktop, Android, Android WebView; iOS null) — filed under “Enabled by default” in the milestone=160 listing |
|---|---|
| V8 / Finch flag | V8 feature flag js_regexp_buffer_boundaries in V8 src/flags/feature-flags.h; ChromeStatus records Finch name V8Flag_js_regexp_buffer_boundaries (no origin trial, no chrome://flags entry) |
| Specification | Regular Expression Buffer Boundaries for ECMAScript (TC39 Stage 3 Draft) · Proposal repository & explainer · tc39/ecma262#3905 |
| Intent | blink-dev Intent to Ship |
| Tracking bug | issues.chromium.org/517575874 |
| Conformance tests | tc39/test262#4975 (Test262 acceptance tests) |
| ChromeStatus | 5187917373898752 — Regular Expression Buffer Boundaries (component Blink>JavaScript>Regexp) |
references
- MDN — Buffer boundary assertion:
\A,\z,\Z(canonical reference) - MDN — Input boundary assertion:
^,$ - TC39 Specification — Regular Expression Buffer Boundaries for ECMAScript · GitHub explainer
- Test262 acceptance tests (tc39/test262#4975)
- Chrome Platform Status — Regular Expression Buffer Boundaries (5187917373898752) (API record)
- Chrome Platform Showcase — interactive demos