I've recently inherited a number of php files that served as email templates. These php files consist of strings concatenated with php variables. I would like to find all the variable names used in the template files so that I'm able to replace these names with the proper tags for Jinja2 templates I'm using now. Here's a snippet from one of the templates:
<?php if($lang == 'EN'){
################################# ENGLISH ####################################-->
$html1 = '
Dear '.$firstname.',
<br /><br />
We are contacting you in regards your recent order # '.$custmordernum.'. TO COMPLETE YOUR ORDER WE NEED
ADDITIONAL INFORMATION FROM YOU. Your order will be on hold until WE RECEIVE THE FOLLOWING
}
else {
################################# SPANISH ####################################-->
I've had limited success using the following regular expression:
(\'.*?\..*?\..*?\')
I'd like to match everything between the periods. Can anyone suggest a better regular expression?
$a_str="apples:".cost_of_apples(1.23,5.67)." and extras"
seems like it would be problematic ... what are you trying to do this for ... this approach may not be the best one