Hi Guys,
I am trying to use a regular expression to find a certain string within a textbox.
Is it possible to include the equals sign (=) within the regex so it looks for this? When i type the equals sign within the regex it doesn't fnid it any more.
Works when searching this string - "and JobID 816138</Detail>":
Don't Work when searching "?JobID=816138</Detail>":Code:Dim MatchJobId As System.Text.RegularExpressions.MatchCollection = System.Text.RegularExpressions.Regex.Matches(MyResults, "(?<=and JobID ).+?(?=</Detail>)", System.Text.RegularExpressions.RegexOptions.Singleline)
Do i have to use different characters for the = and ? sign when they are being included within the regex search?Code:Dim MatchJobId As System.Text.RegularExpressions.MatchCollection = System.Text.RegularExpressions.Regex.Matches(MyResults, "(?<=?JobID=).+?(?=</Detail>)", System.Text.RegularExpressions.RegexOptions.Singleline)
Thanks,
Chloe ~X~




Reply With Quote