regex - php preg_match with multiple patterns -
i have 2 patterns , want search them in string. this:
$pattern = '/,3$/' $pattern = '/^1,/';
actually want find strings start
or end 1,
,3
my strings in format:
a => 1,2 b => 31,2 c => 4,3
for example , c matches!
how can use preg_match check patterns?
tanks helps.
try way
preg_match("/^1,|,3$/", $string)
Comments
Post a Comment