Regex - PHP Lookaround
I have a string, such as this: $foo = 'Hello __("How are you") I am __("very good thank you")' I know it's a strange string, but stay with me please :P I need a regex expression that will look for the content between __("Look for content here") and put it in an array. i.e. the regular expression would find "How are you" and "very good thank you". Try this: preg_match_all('/(?<=__\(").*?(?="\))/s', $foo, $matches); print_r($matches); which means: (?<= # start positive look behind __\(" # match the characters '__("' ) # end positive look behind .*? # match any character and repeat it zero or