-
Notifications
You must be signed in to change notification settings - Fork 12
Add FAQ entry on differences between v and u
#63
Changes from 1 commit
95db095
4af6d41
1d59066
e1f1ec6
326c11c
48748ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,6 +194,52 @@ In other words, the new flag would indicate several connected changes related to | |
|
|
||
| For more discussion see [issue 2](https://github.com/tc39/proposal-regexp-set-notation/issues/2). | ||
|
|
||
| ### How is the `v` flag different from the `u` flag? | ||
|
|
||
| The answer to this question can be useful when “upgrading” existing `u` RegExps to use `v`. Here’s an overview of the differences: | ||
|
|
||
| 1. Previously invalid patterns making use of the new syntax (see above) now become valid, e.g. | ||
|
|
||
| ``` | ||
| [\p{ASCII_Hex_Digit}--[Ff]] | ||
| \p{RGI_Emoji} | ||
| [_\q{a|bc|def}] | ||
| ``` | ||
|
|
||
| - Some previously valid patterns are now errors, specifically those with a character class including either an unescaped [special character](https://arai-a.github.io/ecma262-compare/snapshot.html?pr=2418#prod-ClassSetSyntaxCharacter) `(` `)` `[` `]` `{` `}` `/` `-` `\` `|` or [a double punctuator](https://arai-a.github.io/ecma262-compare/snapshot.html?pr=2418#prod-ClassSetReservedDoublePunctuator): | ||
mathiasbynens marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ``` | ||
| [(] | ||
| [)] | ||
| [[] | ||
| [{] | ||
| [}] | ||
| [/] | ||
| [-] | ||
| [|] | ||
| [&&] | ||
| [!!] | ||
| [##] | ||
| [$$] | ||
| [%%] | ||
| [**] | ||
| [++] | ||
| [,,] | ||
| [..] | ||
| [::] | ||
| [;;] | ||
| [<<] | ||
| [==] | ||
| [>>] | ||
| [??] | ||
| [@@] | ||
| [^^] | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gibson042 @markusicu @macchiati @pthier Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO it isn't, as the first
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR: #74 |
||
| [``] | ||
| [~~] | ||
| ``` | ||
|
|
||
| - The `u` flag suffers from confusing case-insensitive matching behavior. The `v` flag has different, improved semantics. See [issue #30](https://github.com/tc39/proposal-regexp-set-notation/issues/30) for details. | ||
mathiasbynens marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### What’s the precedent in other RegExp flavors? | ||
|
|
||
| Several other regex engines support some or all of the proposed extensions in some form: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.