php / php/doc-en

Document "\x{...}" and "\N{U+...}" Unicode escapes in PCRE patterns

Open
#5,404 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Affected page

https://www.php.net/manual/en/regexp.reference.escape.php

Current issue

The PHP manual page describing escape sequences in PCRE patterns
(regexp.reference.escape.php) currently does not document two Unicode
escape syntaxes supported by PCRE2:

  • \x{hhhh}
  • \N{U+hhhh}

Both forms allow matching a Unicode character by its code point and are
supported by the PCRE2 engine.

Adding these escape sequences to the documentation would improve
completeness and help users write portable Unicode-aware regular
expressions.

reference:
https://pcre2project.github.io/pcre2/doc/pcre2pattern/

Suggested improvement

\x{hhhh}

Matches the Unicode character whose code point is U+hhhh.

\N{U+hhhh}

Matches the Unicode character whose code point is U+hhhh.

Additional context (optional)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open en/regexp.reference.escape.php, the affected manual page, and compare its escape-sequence coverage with the linked PCRE2 pattern reference. Add descriptions for \x{hhhh} and \N{U+hhhh}, then verify that both Unicode code-point escape syntaxes are documented accurately.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.