From e71e24b5b5cacb93aab3a62e809414fbe9c8a438 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 15:02:44 +0900 Subject: docs(regex): add regex porting rules Document the conventions for porting PCRE patterns to the regex crate (no PCRE crate, panic on compile failure, dropping performance-only possessive quantifiers, ad-hoc compatibility comments). Apply the rule to Platform::expand_path by rewriting its conditional subpattern as an explicit alternation, which the regex crate can compile. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe-external-packages/src/composer/pcre/preg.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crates/shirabe-external-packages/src') diff --git a/crates/shirabe-external-packages/src/composer/pcre/preg.rs b/crates/shirabe-external-packages/src/composer/pcre/preg.rs index 1ff7dc6..2c7430d 100644 --- a/crates/shirabe-external-packages/src/composer/pcre/preg.rs +++ b/crates/shirabe-external-packages/src/composer/pcre/preg.rs @@ -8,6 +8,8 @@ //! - `UnexpectedNullMatchException`: thrown by the `Preg::*StrictGroups()` variants when a capture //! group did not participate. Those variants were dropped because Rust's `Option` already //! distinguishes participating from non-participating groups. +//! +//! See docs/dev/regex-porting.md for more detailed regex porting rules. use indexmap::IndexMap; use shirabe_php_shim::{ -- cgit v1.3.1