Dup Goto 📝

preg family in PHP

PT2/lang/php/regex php regex 07-04 20:08:25
To Pop
16 lines, 133 words, 932 chars Thursday 2024-07-04 20:08:25
preg_match('/regex/',$subject);

Split

// $limit is max number of substrings returned,
// one more than what you'd use in Python
preg_split('/regex/',$subject,$limit,$flags);

Flags

From the official docs. $flags can be any combination of the following flags (combined with the | bitwise operator):