I wonder how I can exclude a substring from the result after it matches the pattern. Example:
<a href="?page1"><?php __('string1');?></a>
<a href="?page2"><?php __("string2");?></a>
I want to get only the strings passed as parameters to the __ () function. I tried this regex:
'/__\(((\'([^\']+)\')|(\"([^\"]+)\"))/'
but returns "string1" and "string2" enclosed in single quotes and double quotes.
how can i exclude single quotes and double quotes?
source
share