Delimited patterns
#
Delimited patternMethod Pattern.delimited()
returns regular expression as string
,
representing the pattern in format compatible with with PHP PCRE methods.
#
PCRE-style patternsIf the Pattern
was constructed with PcrePattern::of()
, method delimited()
returns the pattern unchanged.
However, certain regular expressions will be modified to allow safe execution. For example, pattern /\c\/
fails matching in vanilla PHP, so such pattern is delimited in other ways, to ensure proper execution.
#
ModifiersThere are two ways of using patterns with PCRE modifiers:
Either pass a second argument to
pattern()
/Pattern::of()
:or use an old-school pattern: