Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?<=[a-z])(?=[0-9]+)
/
i

Description

$str = '12jan'; $arr = preg_split('/(?<=[a-z])(?=[0-9]+)/i',$str);
print_r($arr);

OUTPUT: Array ( [0] => RO [1] => 123 )

Submitted by Ionut M Ionete - 8 years ago