Modifier flags

ignoreCase

The ignoreCase method adds flags PCRE_CASELESS to the pattern.
If this flag is set, the letters in the pattern match both uppercase and lower case letters.

use Rudashi\Regex;
 
$regex = Regex::build()->ignoreCase();
 
// /i

multiline

The multiline method adds flags PCRE_MULTILINE to the pattern.
When this flag is set, the start and end anchors match immediately following or before any newline in the context string.

use Rudashi\Regex;
 
$regex = Regex::build()->multiline();
 
// /m

matchNewLine

The matchNewLine method adds flags PCRE_DOTALL to the pattern.
If this flag is set, . in the pattern matches additionally with newlines.

use Rudashi\Regex;
 
$regex = Regex::build()->matchNewLine();
 
// /s

ignoreWhitespace

The ignoreWhitespace method adds flags PCRE_EXTENDED to the pattern.
If this flag is set, whitespace in the pattern is completely ignored, except when escaped or with characters between an unescaped #.

use Rudashi\Regex;
 
$regex = Regex::build()->ignoreWhitespace();
 
// x

utf8

The utf8 method adds flags PCRE_UTF8 to the pattern.
If this flag is set, the pattern and context string are treated as UTF-8.

use Rudashi\Regex;
 
$regex = Regex::build()->utf8();
 
// /u

unicode

The unicode method is an alias for the utf8 method.

use Rudashi\Regex;
 
$regex = Regex::build()->unicode();
 
// /u
Fluent Regex
rudashi · © 2024 All rights reserved