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

Difference between \p and \P in Unicode RegExps is never explained #38168

Closed
elisee opened this issue Feb 15, 2025 · 2 comments
Closed

Difference between \p and \P in Unicode RegExps is never explained #38168

elisee opened this issue Feb 15, 2025 · 2 comments
Labels
closed: question A user misinterpretation or support question. No action required. Content:JS JavaScript docs

Comments

@elisee
Copy link

elisee commented Feb 15, 2025

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Unicode_character_class_escape

What specific section or headline is this issue about?

No response

What information was incorrect, unhelpful, or incomplete?

Hi! Thanks for the all work on MDN.

On the page about \p and \P escapes for Unicode RegExp, as far as I can tell, there is no mention of the fact that \p means "match the category" and \P means "match the negated category"

What did you expect to see?

There should be a line explaining that one is the negation of the other.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@elisee elisee added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 15, 2025
@github-actions github-actions bot added the Content:JS JavaScript docs label Feb 15, 2025
@elisee elisee changed the title Difference between \p and \P is never explained Difference between \p and \P in Unicode RegExps is never explained Feb 15, 2025
@Josh-Cena
Copy link
Member

There's the following sentence:

\P creates a complement class that consists of code points without the specified property.

#38012 also added more information about what that means exactly.

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2025
@Josh-Cena Josh-Cena added closed: question A user misinterpretation or support question. No action required. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Feb 15, 2025
@elisee
Copy link
Author

elisee commented Feb 16, 2025

There's the following sentence:

\P creates a complement class that consists of code points without the specified property.

#38012 also added more information about what that means exactly.

Ah, I missed this sentence. IMHO this buried too deep and the distinction belongs in the abstract at the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: question A user misinterpretation or support question. No action required. Content:JS JavaScript docs
Projects
None yet
Development

No branches or pull requests

2 participants