找回密码
 加入
搜索
查看: 1396|回复: 4

正则表达式如何匹配shell32.dll

[复制链接]
发表于 2010-1-22 16:39:40 | 显示全部楼层 |阅读模式
本帖最后由 xlcwxl 于 2010-1-23 15:15 编辑

说明,先检测输入框是否包含了shell32.dll,0到237之间的数字,如果有则不打包
$icon = GUICtrlRead($Input1)
$file = FileOpen(@ScriptDir&"\Shortcut.au3", 2)
if $icon<>"\bshell32.dll,\d" Then FileWrite($file,'FileInstall($icon,@SystemDir&"")' & 
FileClose($file)
EndIf
\bshell32.dll,\d
正则是这样写对吗?
自己解决了;想了另外一种办法
$icon = GUICtrlRead($Input1)
$file = FileOpen(@ScriptDir&"\Shortcut.au3", 2)
if $icon<>"\bshell32.dll,\d" Then FileWrite($file,'FileInstall($icon,@SystemDir&"")' & 
FileClose($file)
EndIf

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-1-22 17:42:44 | 显示全部楼层
如果要求输入很严谨,那么 ^shell32.dll,0|[1-9][0-9]|1[0-9][0-9]|2[0-2][0-9]|23[0-7]$
发表于 2010-1-23 10:34:06 | 显示全部楼层
^shell32\.dll,[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-2][0-9]|23[0-7]$

(.) 是 非换行符 要转义
发表于 2010-1-23 11:07:35 | 显示全部楼层
其实还有个严重问题,FILEINSTALL的第一个参数不支持变量
 楼主| 发表于 2010-1-23 15:14:57 | 显示全部楼层
If $icon<>"" And  StringLeft($icon, 12)<>"shell32.dll," Then FileWrite($file,'FileInstall("'&$icon&'",@SystemDir&"")' & @CRLF)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-28 02:15 , Processed in 0.099924 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表