« Bugzilla Issues Index
#3519 — Maybe omission: Should - be a SyntaxCharacter in regexps?
- bug_id:
3519
- creation_ts:
2015-01-08 05:21:00 -0800
- short_desc:
Maybe omission: Should - be a SyntaxCharacter in regexps?
- delta_ts:
2015-02-02 18:39:05 -0800
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 30: December 24, 2014 Draft
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
enhancement
- everconfirmed:
true
- reporter:
Marja Hölttä
- assigned_to:
Allen Wirfs-Brock
- cc:
mathias
- commentid:
11320
- comment_count:
0
- who:
Marja Hölttä
- bug_when:
2015-01-08 05:21:13 -0800
21.2.1 says:
SyntaxCharacter :: one of
^ $ \ . * + ? ( ) [ ] { } |
And if the 'u' flag is present, only syntax characters can be escaped:
IdentityEscape [U] ::
[+U] SyntaxCharacter
[~U] SourceCharacter but not UnicodeIDContinue
Is - deliberately not a syntax character? This means the user cannot write /[a-b\-f-g]/u but has to write /[a-bf-g-]/u instead.
Other regexp implementations (Python, Perl) allow \- in this context. Otoh, they allow more liberal escaping anyway, such as \a to replace a, and so on.
- commentid:
11568
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2015-01-20 16:24:25 -0800
fixed in rev32 editor's draft
added
ClassEscape[U] :: [+U] -
regexp pattern production
- commentid:
12045
- comment_count:
2
- who:
Allen Wirfs-Brock
- bug_when:
2015-02-02 18:39:05 -0800
fixed in rev32 draft