Skip to content

Commit f83f23a

Browse files
committed
Add link
1 parent 383f065 commit f83f23a

File tree

2 files changed

+3
-3
lines changed
  • files/en-us/web/javascript
    • guide/regular_expressions
    • reference/global_objects/regexp/unicode

2 files changed

+3
-3
lines changed

files/en-us/web/javascript/guide/regular_expressions/index.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,8 @@ For example, the following regular expression might be used to match against an
410410
There are a number of other differences between unicode and non-unicode regular expressions that one should be aware of:
411411

412412
- Unicode regular expressions do not support so-called "identity escapes"; that is, patterns where an escaping backslash is not needed and effectively ignored. For example, `/\a/` is a valid regular expression matching the letter 'a', but `/\a/u` is not.
413-
414413
- Curly brackets need to be escaped when not used as [quantifiers](/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Quantifiers). For example, `/{/` is a valid regular expression matching the curly bracket '{', but `/{/u` is not — instead, the bracket should be escaped and `/\\{/u` should be used instead.
415-
416-
- The `-` character is interpreted differently within character classes. In particular, for unicode regular expressions, `-` is interpreted as a literal `-` (and not as part of a range) only if it appears at the start or end of a pattern. For example, `/[\w-:]/` is a valid regular expression matching a word character, a `-`, or `:`, but `/\w-:/u` is an invalid regular expression, as `\w` to `:` is not a well-defined range of characters.
414+
- The `-` character is interpreted differently within character classes. In particular, for unicode regular expressions, `-` is interpreted as a literal `-` (and not as part of a range) only if it appears at the start or end of the character class. For example, `/[\w-:]/` is a valid regular expression matching a word character, a `-`, or `:`, but `/[\w-:]/u` is an invalid regular expression, as `\w` to `:` is not a well-defined range of characters.
417415

418416
## Examples
419417

files/en-us/web/javascript/reference/global_objects/regexp/unicode/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ The **`unicode`** accessor property indicates whether or not the `u` flag is use
2525
- Surrogate pairs will be interpreted as whole characters instead of two separate characters. For example, `/[😄]/u` would only match `"😄"` but not `"\ud83d"`.
2626
- When [`lastIndex`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) is automatically advanced (such as when calling [`exec()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)), unicode regexps advance by Unicode codepoints instead of UTF-16 code units.
2727

28+
There are other changes to the parsing behavior. [Using unicode regular expressions](/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#using_unicode_regular_expressions) has more information about the Unicode regex syntax.
29+
2830
The set accessor of `unicode` is `undefined`. You cannot change this property directly.
2931

3032
## Examples

0 commit comments

Comments
 (0)