举报
Local $string = _ '127.0.0.1 www.hao123.com' & @CRLF & _ '127.0.0.1 www.hao123.com' & @CRLF & _ '127.0.0.1 www.hao123.com' & @CRLF & _ '64.233.162.83 sites.google.com64.233.162.83 www.hao123.com' Local $sStr = StringRegExpReplace($string, '[\d\.]+\s*?www\.hao123\.com', '') ConsoleWrite($sStr & @CRLF)
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 361, 161, 192, 124) $Input1 = GUICtrlCreateInput("https://www.hao123.com", 40, 40, 273, 21) $Button1 = GUICtrlCreateButton("检查", 112, 88, 129, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 msgbox(0,"", GUICtrlRead($Input1)) EndSwitch WEnd
谢谢了。 在问下, 如何返回 也就是说判断输入框内容,只取网站的主机名,不取//之前的和:及/ ... hearton 发表于 2016-5-7 22:36
MsgBox(0, "", StringRegExpReplace(GUICtrlRead($Input1), '^(?:.*?://)?([^\s:/]+).*', '${1}'))
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度
GMT+8, 2025-2-23 01:08 , Processed in 0.088558 second(s), 23 queries .
Powered by Discuz! X3.5 Licensed
© 2001-2024 Discuz! Team.