I have worked a while on a Regex that will replace a deprecated php command with a new one. This only part of the script but I am stuck on the basic Regex.
What I have is this:
Pattern:
Code: Select all
(.*)(ereg\(")(.*)",(.*)
Code: Select all
// $1$2$3$4\n%CRLF%$1preg("/$3/",$4
Example:
Code: Select all
if(ereg("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})[[:space:]]{1}([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})$", $stringtime, $eregidata))
Code: Select all
// if(ereg("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})[[:space:]]{1}([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})$", $stringtime, $eregidata))
if(preg_replace("/^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})[[:space:]]{1}([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})$/", $stringtime, $eregidata))
http://gskinner.com/RegExr/
But I cannot for the life of me get it to work in MSched.
Does Msched use the replace variables? ($1$2 etc.)
How would I set the /g/m for global and multiline?
So my script patterns are:
Code: Select all
Let>find_first=/(.*)(ereg\(")(.*)",(.*)
Let>replace_first=// $1$2$3$4\n$1preg("/$3/",$4
Code: Select all
Regex>%find_first%,%search_file_txt%,0,match_arr,num_matches,1,%replace_first%,replaced_txt
TIA.
P.