diff --git a/README.md b/README.md index 2f5ef2f..6aea019 100644 --- a/README.md +++ b/README.md @@ -194,22 +194,20 @@ Sets the JavaScript language version for generated patterns and flags. Later tar ## ✅ Supported features -
Description | Example | ES2018 | -ES2024 | -ESNext | +ES2024+[1] | Comments | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Flags | i |
i |
- ✅ | -✅ | -✅ | +✅ | +✅ |
✔ Unicode case folding |
@@ -217,9 +215,8 @@ Sets the JavaScript language version for generated patterns and flags. Later tar
|||||||||
m |
m |
- ✅ | -✅ | -✅ | +✅ | +✅ |
✔ Equivalent to JS flag s (dotAll ) |
@@ -227,9 +224,8 @@ Sets the JavaScript language version for generated patterns and flags. Later tar
||||||||||
x |
x |
- ✅ | -✅ | -✅ | +✅ | +✅ |
✔ Unicode whitespace ignored ✔ Line comments with # @@ -243,10 +239,10 @@ Sets the JavaScript language version for generated patterns and flags. Later tar | Flag modifiers | Groups | (?im-x:…) |
- ✅ | -✅ | -✅ | +✅ | +✅ |
+ ✔ Unicode case folding for i ✔ Allows enabling and disabling the same flag (priority: disable) ✔ Allows lone or multiple - |
@@ -254,9 +250,8 @@ Sets the JavaScript language version for generated patterns and flags. Later tar
|
Directives | (?im-x) |
- ✅ | -✅ | -✅ | +✅ | +✅ |
✔ Continues until end of pattern or group (spanning alternatives) |
@@ -264,9 +259,8 @@ Sets the JavaScript language version for generated patterns and flags. Later tar
||||||||||
Comment groups | (?#…) |
- ✅ | -✅ | -✅ | +✅ | +✅ |
✔ Allows escaping \) , \\ ✔ Comments allowed between a token and its quantifier @@ -277,9 +271,8 @@ Sets the JavaScript language version for generated patterns and flags. Later tar | Characters | Literal | E! |
- ✅ | -✅ | -✅ | +✅ | +✅ |
✔ Code point based matching ✔ Standalone ] , { , } don't require escaping@@ -288,20 +281,18 @@ Sets the JavaScript language version for generated patterns and flags. Later tar | |
Identity escape | \E\! |
- ✅ | -✅ | -✅ | +✅ | +✅ |
✔ Different set than JS ✔ Invalid for multibyte chars |
||||||||||
Metachar | +Char escapes | \t |
- ✅ | -✅ | -✅ | +✅ | +✅ |
✔ JS set plus \a , \e |
@@ -309,143 +300,176 @@ Sets the JavaScript language version for generated patterns and flags. Later tar
|||||||||
\x |
\xA0 |
- ✅ | -✅ | -✅ | +✅ | +✅ |
✔ 1-digit hex \xA ✔ 2-digit hex \xA0 - ✔ Incomplete \x invalid |
||||||||||
\u |
\uFFFF |
- ✅ | -✅ | -✅ | +✅ | +✅ |
- ✔ Incomplete \u invalid+ ✔ Same as JS |
||||||||||
\u{…} |
\u{A} |
- ✅ | -✅ | -✅ | +✅ | +✅ |
- ✔ Incomplete \u{…} invalid- ✔ Allows whitespace - ✔ Allows leading 0s up to 6 total hex digits + ✔ Allows whitespace padding + ✔ Allows leading 0s up to 6 total hex digits (JS allows unlimited) |
||||||||||
Escaped num | \20 |
- ✅ | -✅ | -✅ | +✅ | +✅ |
- ✔ Can be null, backref, error, octal, identity escape, literal, or multiple of these, based on complex context - ✔ Always treat escaped single digit 1-9 outside char class as backref + ✔ Can be backref, error, null, octal, identity escape, or one these combined with literal digits, based on complex context + ✔ Always treats escaped single digit 1-9 outside char class as backref |
||||||||||
Control | -\C-A |
- ✅ | -✅ | -✅ | +\cA , \C-A |
+ ✅ | +✅ |
- ✔ \cx with A-Za-z- ✔ \C-x with A-Za-z- ✔ Incomplete \c /\C invalid+ ✔ With A-Za-z (JS: only \c ) |
|||||||||
Other | \M-\1 |
- ✖️ | -✖️ | -✖️ | +✖️ | +✖️ |
- Not yet supported; all extremely rare + Not yet supported; very rare ✘ \cx , \C-x with non-A-Za-z✘ Meta-code \M-x , \M-\C-x |
||||||||||
Character sets | -Dot | -. |
- ✅ | -✅ | -✅ | +Character sets | +Digit, word | +\d , \w , etc. |
+ ✅ | +✅ |
- ✔ Excludes only \n (unlike JS)- |
- ||||||
Digit | -\d\D |
- ✅ | -✅ | -✅ | -
- ✔ ASCII + ✔ Same as JS (ASCII) |
||||||||||||
Hex digit | -\h\H |
- ✅ | -✅ | -✅ | +\h , \H |
+ ✅ | +✅ |
✔ ASCII |
|||||||||
Word | -\w\W |
- ✅ | -✅ | -✅ | +Whitespace | +\s , \S |
+ ✅ | +✅ |
- ✔ ASCII + ✔ ASCII (unlike JS) |
||||||||
Whitespace | -\s\S |
- ✅ | -✅ | -✅ | +Dot | +. |
+ ✅ | +✅ |
- ✔ ASCII (unlike JS) + ✔ Excludes only \n (unlike JS) |
||||||||
Unicode property \p /\P |
- \p{greek} |
- ✅ [1] | -✅ | -✅ | +Unicode property | +\p{L} , \P{L} |
+ ✅[2] | +✅ |
✔ Categories ✔ Binary properties ✔ Scripts - ✘ Blocks (wontfix) ✔ Aliases + ✔ POSIX + ✘ Blocks (wontfix) ✔ Negate with \p{^…} , \P{^…} ✔ Insignificant spaces, underscores, and casing in names - ✔ \p /\P is identity escape- ✔ Incomplete \p{ /\P{ invalid+ ✔ \p , \P without { is identity escape✔ JS prefixes (ex: Script= ) invalid✔ JS properties of strings invalid |
||||||||
Character classes | +Base | +[ab] , [^a] |
+ ✅ | +✅ | +
+ ✔ Literal unescaped - in some contexts (different than any JS mode)+ ✔ Fewer chars require escaping than JS + ✔ No subtraction operator (from JS flag v )+ |
+ ||||||||||||
Empty | +[] , [^] |
+ ✅ | +✅ | +
+ ✔ Invalid (unlike JS) + |
+ |||||||||||||
Ranges | +[a-z] |
+ ✅ | +✅ | +
+ ✔ Same as JS with flag u , v + |
+ |||||||||||||
POSIX classes | +[[:word:]] |
+ ☑️[3] | +✅ | +
+ ✔ Unicode interpretations + ✔ Negate with [:^…:] + |
+ |||||||||||||
Nested classes | +[a[b]] |
+ ☑️[4] | +✅ | +
+ ✔ Same as JS with flag v + |
+ |||||||||||||
Intersection | +[a-z&&\h] |
+ ❌ | +✅ | +
+ ✔ Doesn't require nested classes for union and ranges (unlike JS) + |
+ |||||||||||||
Work in progress… |