Hi
I want to match strings like those below.
abc|q:1,f:2
cba|q:1,f:awd2,t:3awd,h:gr
I am using php and have tried both preg_match
and preg_match_all
with this expression.
/^([a-z]+)\|([a-z]+:[a-z0-9]+,?)+$/iU
This only returns the first part before the pipe, and one a:1. What am I doing wrong, why is it behaving this way and how can I make it work?