resago Posted February 6, 2008 Share Posted February 6, 2008 this $a=preg_replace('/md5 *\( *(.+) *\)/is','$1',$a);#in case we missed some in the first pass mostly works, except for: before: $sQuery = "UPDATE `Profiles` SET `Password` = md5(`Password`) WHERE `ID`='{$memb_arr['ID']}'"; and after: $sQuery = "UPDATE `Profiles` SET `Password` = `Password`) WHERE `ID`='{$memb_arr['ID']}'"; any suggestions? I'm guessing cause my regex is greedy, but I don't see how its matching if its being greedy. Link to comment https://forums.phpfreaks.com/topic/89645-solved-matchingreplacing-problem/ Share on other sites More sharing options...
resago Posted February 6, 2008 Author Share Posted February 6, 2008 its leaving the ) in the match for some reason? the regex is to remove the md5 function from my scripts without me having to edit them all by hand. it reads the entire file into a string, hense the /s Link to comment https://forums.phpfreaks.com/topic/89645-solved-matchingreplacing-problem/#findComment-459328 Share on other sites More sharing options...
laffin Posted February 6, 2008 Share Posted February 6, 2008 $a=preg_replace('/md5 *\( *([^\)]+) *\)/is','$1',$a); try a different approach Link to comment https://forums.phpfreaks.com/topic/89645-solved-matchingreplacing-problem/#findComment-459556 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.