Regex
Methods for regex strings.
Note: Backslashes \
in regex strings do not need to be escaped.
// Regex literal string $pattern = r'\d+ \w+'; // Creating a Regex from a dynamic string $word = '(\\w+)'; $pattern = new Regex($word, 'i');
Methods for regex strings.
Note: Backslashes \
in regex strings do not need to be escaped.
// Regex literal string $pattern = r'\d+ \w+'; // Creating a Regex from a dynamic string $word = '(\\w+)'; $pattern = new Regex($word, 'i');