jinbaba Posted November 11, 2008 Share Posted November 11, 2008 (edited) Hello Folks, I want to write a regex that finds if the given string starts and ends with character " (double qoute) e.g. If string is "***" then Return True Else ; Do something else. I wrote small code Local $Pcap = '"E:\edonkey.pcap"' Local $retVal = StringRegExp($Pcap, '"\S+"', 0) ;Local $retVal = StringRegExp($Pcap, '\S+"', 0) MsgBox(0, "Search Result", "Return value is: " & $retVal) The problem is, it always returns 0 (no match). But if I remove the double qoute char at beginning of regex it works. As done in commented line. The question is why it is not matching initial double qoute. I tried escaping ", but it didn't worked. Any help in resolving this issue. Thanx Jinbaba Edited November 11, 2008 by jinbaba Link to comment Share on other sites More sharing options...
Armand Posted November 11, 2008 Share Posted November 11, 2008 there is no capture group... try this: Local $Pcap = '"E:\edonkey.pcap"' Local $retVal = StringRegExp($Pcap, '"(\S+)"', 0) MsgBox(0, "Search Result", "Return value is: " & $retVal) [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
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