Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character class negation is undocumented #40

Closed
mdinger opened this issue Jan 15, 2015 · 2 comments
Closed

Character class negation is undocumented #40

mdinger opened this issue Jan 15, 2015 · 2 comments
Labels
docs Documentation issue (primary issue type)

Comments

@mdinger
Copy link
Contributor

mdinger commented Jan 15, 2015

Character class negation isn't documented anywhere in regex. I asked on IRC where they told be the syntax is <-[abcd]> compared with Perl5 [^abcd].

This should be documented.

@pmichaud
Copy link
Collaborator

It's kind of documented, but not as clearly as it ought to be. The text currently reads:

In between the < > , you can also use the same operators for categories (+, |, &, -, ^) to combine multiple range definitions and even mix in some of the unicode categories above. Another thing you are allowed to write between the [ ] is the backslashed forms for character classes.

The + and - "operators" it refers to are the ones that handling character class addition and negation. I agree it's unclear as written, and there ought to be an example showing the most common negation form.

@mdinger
Copy link
Contributor Author

mdinger commented Jan 15, 2015

Awesome! I'd also expand on how operators behave when on the endpoints they are usually binary operators and it might not be immediately apparent how they might operate as lone prefixes/suffixes (although, now that I think about it, I can see how they might operate).

@moritz moritz closed this as completed in c5c4e68 Jan 15, 2015
@AlexDaniel AlexDaniel added the docs Documentation issue (primary issue type) label Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type)
Projects
None yet
Development

No branches or pull requests

3 participants