This repository was archived by the owner on Jun 6, 2018. It is now read-only.
Added Unicode category support - #11
Open
cmkilger wants to merge 2 commits into
Open
Conversation
Owner
|
Thank you for this change. As far as I can tell, Unicode categories aren't supported by JavaScript-style regular expressions (which is all that Regexper supports at this time), so I'm not going to merge this right now. I will keep this change around though for when other regex styles are added to the site. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I added support for Unicode categories, as listed on this site, e.g.
\p{P}for punctuation or\p{Cherokee}for Cherokee characters. I'm not sure how you would actually want to do this, so I just went for it. It doesn't verify to make sure that the value used and just assumes it is available. And it uses some heuristics to try and format it properly.If you'd rather, all possible values could be added to the grammar, and then there could be a big map to the descriptions of each one.