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 1, or end ,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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -