Skip to content

Document the regex engines - #152

Merged
ryangjchandler merged 1 commit into
3.xfrom
docs/regex-engines
Nov 3, 2026
Merged

ryangjchandler merged 1 commit into
3.xfrom
docs/regex-engines

Conversation

@ryangjchandler

Copy link
Copy Markdown
Collaborator

Adds a Regex engines page under Usage in the docs.

  • Explains why Phiki has both Oniguruma and PCRE engines (mbregex is deprecated in PHP 8.6, removed in PHP 9, and missing from some builds).
  • Shows how to choose an engine with Phiki::engine(), and the default (Oniguruma when mb_ereg_search_* is available, otherwise PCRE).
  • Notes that custom grammars are used as they are, so they need syntax the chosen engine understands.
  • Warns that the engines aren't 100% compatible because of differences in regex syntax, that we compare both against vscode-textmate, and that PCRE is sometimes more accurate than Oniguruma. Links to COMPATIBILITY.md.

Explain why Phiki has Oniguruma and PCRE engines, how to choose one,
and that the engines are not fully compatible with each other.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1a3ca-65bc-72de-95d2-bb12f8d5082c
Co-authored-by: Ryan Chandler <ryan@ryangjchandler.co.uk>
@ryangjchandler
ryangjchandler merged commit f393d2f into 3.x Nov 3, 2026
4 of 5 checks passed
@ryangjchandler
ryangjchandler deleted the docs/regex-engines branch November 3, 2026 23:46
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

Successfully merging this pull request may close these issues.

2 participants