i need to solve a problem with a regular expression but so far i don't get a solution for that.
I need to obtain, in a string, all the occurrences between ' ' , but ignoring something like \' in the middle.
Practical example:
Code: Select all
$str = "this is a ' test for my regexp. i have
something called \'Something\', but i don't want
to check that quotes'. so 'on' etc..";
Code: Select all
0 => 'test for my regexp. i have something called \'Something\', but i don't want
to check that quotes
1 => 'on'i don't want to get
Code: Select all
0 => 'test for my regexp. i have something called \'My (best) current reg exp to do that :
Code: Select all
preg_match_all("/'[^']+'/s", .., ...);Any help would be appreciated!!
Alessandro