Regular expression works in Javascript but not PHP preg_match
Regular expression:
/([^]+):([^\\r\\n]+)/
String:
f1:aaa\r\nf2:bbb\r\nf3:ccc\r\nf4:ddd
According to regexpal.com, this would give my desired sets: f1 & aaa, f2 &
bbb, f3 & ccc etc. But using
http://www.functions-online.com/preg_match.html I only see [0] => "f1" and
[1] => "f1"
Can anyone show how I should be doing this?
No comments:
Post a Comment