Home All Groups Group Topic Archive Search About
Author
31 Oct 2007 2:44 PM
Barry
Hi

I need to capture

/contract_info/index.asp?action=Delete&site=DB&id=17016852

from

dim s as string = "<a
href="javascript:NewWindow('/contract_info/index.asp?action=Delete&site=DB&id=17016852')">Details</a>"

Dim mtch As Match = Regex.Matches(s, """javascript:NewWindow((.*?)",
RegexOptions.Singleline Or RegexOptions.IgnoreCase)


Note: compiler will create problem on the 1st line ie dims as string =???
TIA

Author
31 Oct 2007 8:50 PM
Jesse Houwing
Hello Barry,

Show quote
> Hi
>
> I need to capture
>
> /contract_info/index.asp?action=Delete&site=DB&id=17016852
>
> from
>
> dim s as string = "<a
> href="javascript:NewWindow('/contract_info/index.asp?action=Delete&sit
> e=DB&id=17016852')">Details</a>"
>
> Dim mtch As Match = Regex.Matches(s, """javascript:NewWindow((.*?)",
> RegexOptions.Singleline Or RegexOptions.IgnoreCase)
>
> Note: compiler will create problem on the 1st line ie dims as string
> =??? TIA

You need to escape the additional "s in your string. If I remember correctly
you do that by doubling the "s to make it:

dim s as string = "<a href=""javascript:NewWindow('/contract_info/index.asp?action=Delete&site=DB&id=17016852')"">Details</a>"

The reges would be what you've created, or more exactly:

NewWindow\('([^']+)'\)

--
Jesse Houwing
jesse.houwing at sogeti.nl

AddThis Social Bookmark Button