Groups
Groups
Sign in
Groups
Groups
TopLanguage
Conversations
About
Send feedback
Help
求教正则表达式识别文件全路径、可执行文件、参数
52 views
Skip to first unread message
Todd Gao
unread,
May 20, 2012, 8:29:32 AM
5/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pon...@googlegroups.com
请教一个正则表达式的写法,能够识别这样的字符串
c:\Program Files\App\app.exe -t normal
能够识别出其中的文件路径(c:\Program Files\App\app.exe),可执行文件(app.exe),还有参数(-t normal)
当然能够识别出这种路径 %systemroot%\notepad.exe,就是带有系统变量的就更厉害了!
希望能够给出语言的实现,最好是C#了!谢谢!
软刀
unread,
May 20, 2012, 2:06:30 PM
5/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pon...@googlegroups.com
对于这封邮件感觉怪怪的,抱歉,允许我打叉下
Úcarenya
unread,
May 20, 2012, 9:50:30 PM
5/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pon...@googlegroups.com
对字符串用正则是自找麻烦了,目录里有空个又没有引号,你怎么判断?
除非你有类似coreutil里find那样的OS/Filesys级别的实现
还是用你所用语言的自带库吧
sigh, 我本来要说:
FOR /F "eol=; tokens=1,2* delims=, " %i in ('echo a b c') do @echo %i %j %k
--
- Úcarenya - infernoxu at gmail dot com
-
http://ucarenya.com/
Reply all
Reply to author
Forward
0 new messages