4 ms·
Here's what a regexp for a C-style identifier looks like (ranges are inclusive): [a-zA-Z_][a-zA-Z0-9_]* Here's what the same regexp would look like if reg
by patrec 4y ago
Here's what a regexp for a C-style identifier looks like (ranges are inclusive):
[a-zA-Z_][a-zA-Z0-9_]*
Here's what the same regexp would look like if regexp ranges were end-exclusive:
[a-{A-[][a-{A-[0-:_]*
Do you see the issue now? Of course if regexps really worked that way, you'd be better off doing this instead:
[a-zzA-ZZ][a-zzA-ZZ0-99_]
But that specific trick only works because regexp ranges occur in a set union context.
- deleted 4y ago[deleted]
- anonymoushn 4y agoI see, the `a-z` range has an inclusive upper bound. That makes sense and it really should be like that.