RegExp.prototype.unicode
examples are not helpful
#2490
Labels
Content:JS
issues related to JavaScript examples.
idle
Issues and pull requests with no activity for three months.
What information was incorrect, unhelpful, or incomplete?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode
The current example just shows how to access the property, it does not show at all what effect the Regex flag has.
What did you expect to see?
The example should show what difference the
u
flag has, at the very least something like:However, the
\\u{...}
example might be a bit pointless because you can just write\u{...}
which is understood uses a JavaScript escape sequence and therefore works regardless of whether theu
flag is used or not (I assume).1A more interesting example might be to match a Unicode property, and / or to show that matching emojis (respectively in general any supplementary character) only works correctly when using the
u
flag.Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
Footnotes
This also highlights a bug with the current example; the
↩\u{61}
is (if I understand it correctly) a normal JavaScript escape, so the current example is equivalent to:The text was updated successfully, but these errors were encountered: