Regex: Added aliases and minor improvements #2325
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After this reminder, I added aliases to some regex tokens to add some actual highlighting. Before this, regex did tokenized regular expressions but intentionally used token names not recognized by any theme because I felt at the time that the usual colors didn't fit regexes.
Improvements:
.
is no longer highlighted as a character class inside charsets.?
and possessive+
quantifier.The aliases:
I added aliases so that regexes look reasonably well with all themes without making any modifications to any theme. It's not perfect since themes simply weren't built with regex tokenization in mind but I think it's ok.
Screenshots