Skip to content
This repository has been archived by the owner on Feb 18, 2025. It is now read-only.

Commit

Permalink
Editorial: Add note about leading-digit escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 authored Apr 1, 2024
1 parent aee5a2c commit 3d45b23
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ contributors: Jordan Harband
1. Let _cpList_ be StringToCodePoints(_S_).
1. For each code point _c_ in _cpList_, do
1. If _escaped_ is the empty String and _c_ is matched by |DecimalDigit|, then
1. NOTE: Escaping a leading digit ensures that output corresponds with pattern text which may be used after a `\0` character escape or a |DecimalEscape| such as `\1` and still match _S_ rather than be interpreted as an extension of the preceding escape sequence.
1. Set _escaped_ to the string-concatenation of _escaped_, the code unit 0x005C (REVERSE SOLIDUS), *"x3"*, and the code unit whose numeric value is the numeric value of _c_.
1. Else,
1. Set _escaped_ to the string-concatenation of _escaped_ and EncodeForRegExpEscape(_c_).
Expand Down

0 comments on commit 3d45b23

Please sign in to comment.