ChrisL Posted August 9, 2008 Posted August 9, 2008 (edited) I have this... $str = "< > & ' """ $str = StringReplace($str,"&","&") $str = StringReplace($str,"<","<") $str = StringReplace($str,">",">") $str = StringReplace($str,"'","'") $str = StringReplace($str,'"',""") Msgbox(0,"",$str) Is there a better way with StringRegExpReplace() to replace all in 1 go I could only seem to do it the same as I would with StringReplcae() by doing 1 item at a time. Edited August 9, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
ResNullius Posted August 10, 2008 Posted August 10, 2008 (edited) Don't think so with SRE, but what about something like this: Dim $aReplacements[2][5]=[["&","<",">","'",'"'],["&","<",">","'","""]] For $i = 0 to UBound($aReplacements,2)-1 $str = StringReplace($str,$aReplacements[0][$i],$aReplacements[1][$i]) Next Msgbox(0,"",$str) Edited August 10, 2008 by ResNullius
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now