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

PCRE pattern parse error: Incomplete \\p{X} character escape. #886

Closed
matbech opened this issue Dec 5, 2020 · 1 comment
Closed

PCRE pattern parse error: Incomplete \\p{X} character escape. #886

matbech opened this issue Dec 5, 2020 · 1 comment

Comments

@matbech
Copy link
Contributor

matbech commented Dec 5, 2020

The following PCRE syntax is correct but PeachPie does not recognize it because of the missing curly brackets:
preg_match('/\pL/u', 'a')

The curly brackets are optional in some cases. From the PCRE specification:

If only one letter is specified with \p or \P, it includes all the general category properties that start with that letter. In this case, in the absence of negation, the curly brackets in the escape sequence are optional; these two examples have the same effect:

  \p{L}
  \pL

Reference:
https://www.pcre.org/original/doc/html/pcrepattern.html

@jakubmisek
Copy link
Member

thanks for noticing!

jakubmisek added a commit that referenced this issue Dec 12, 2020
implements #886
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants