非常感谢!
用7#方法成功,
大神可能是没明白我的意思,
Local $Str = _
' <title>正则</title>' & @CRLF & _
' <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' & @CRLF & _
' <script src="js/swfobject.js" type="text/javascript"></script>' & @CRLF & _
' <script src="js/rightclick.js" type="text/javascript"></script>' & @CRLF & _
' <script src="js/jquery.js" type="text/javascript"></script>' & @CRLF & _
' <script src="js/jquery_cookie.js" type="text/javascript"></script>' & @CRLF & _
' <script src="js/swffit.js" type="text/javascript"></script>' & @CRLF & _
' <script type="text/javascript">' & @CRLF & _
" function navigateToSignIn(){window.onbeforeunload=null;window.location.href='http://127.0.0.1';}" & @CRLF & _
' function navigateToReg(){navigateToSignIn();}' & @CRLF & _
' function navigateToLogin(){navigateToSignIn();}' & @CRLF & _
' function OnYouKeSession(session_id){}' & @CRLF & _
' function OnScreenMode(minw,minh,maxw,maxh){' & @CRLF & _
' swffit.fit("customRightClick",minw,minh,maxw,maxh);' & @CRLF & _
' }' & @CRLF & _
' function refreshThisPage()' & @CRLF & _
' define("GAMEURL","http://117.41.229.50:99/indexreal.html");' &@CRLF & _
'{' & @CRLF & _
' document.location.href=document.location.href;' & @CRLF & _
'}' & @CRLF & @CRLF & _
' function game_shouchang(){' & @CRLF & _
" window.external.addFavorite('http://127.0.0.1/','正则');" & @CRLF & _
' }' & @CRLF & _
' ' & @CRLF & _
' function OnSetChinaLimit(realname,cid,sid){' & @CRLF & _
' if (realname != ""&&cid!=""){' & @CRLF & _
' $.ajax({' & @CRLF & _
' type: "GET",' & @CRLF & _
' url: "regfcm.php?realname="+realname+"&cid="+cid+"&sid="+sid,' & @CRLF & _
' cache: false,' & @CRLF & _
' success: function(result){' & @CRLF & _
' }' & @CRLF & _
' });' & @CRLF & _
' }else{' & @CRLF & _
' return "fcmerror";' & @CRLF & _
' }' & @CRLF & _
' return "fcmok";' & @CRLF & _
' }'
MsgBox(0, '原字符串', $Str)
Local $tihuan1 = '替换', $tihuan2 = '192.168.1.1' , $tihuan3= '8080'
Local $sRER = StringRegExpReplace($str, '(?i)(?<=<title>)[^<]+', $tihuan1)
$sRER = StringRegExpReplace($sRER, "(?i)(\.addFavorite.+?',')[^']+", '${1}' & $tihuan2)
MsgBox(0, '替换结果', $sRER)
; 用大神这个没成功,代码中有2处出现了“正则”都要替换成 $tihuan1
; 代码中出现IP的地方都要替换成 $tihuan2
; define("GAMEURL","http://117.41.229.50:99/indexreal.html") 这里出现的“99” 替换成 $tihuan3
; 特别提示: 上述要替换的地方其值不是固定的
;
;
|