I am again stuck in php regex part of my app 🙁
Actually I am searching a type of an universal regex which will search and replace by template
-Any string, which has before string A and ends with string B
-Take that string with the starting string A and with starting string B
-insert it
so lets say I have a need to search in code all
$template = 'admin_list.tpl';
I could make
$start="$template = '"; $end="';";
$template= "????????????????????";
$ocur=preg_match_all($search_template,$file_get_contents,$matches);
so what to put instead of ?????????????? so that generally the search of content inside some given A and B will be found?
If I understand your question and you’re just looking for a regex to match everything between two strings, you’d probably just us something like:
In PHP if you are assembling the regex, you may want to do: