Image

Regular Expressions

I have a bit of code I was hoping would parse all the text in the variable
sInput and find 3 text string. It only finds one

[link href="/_styles/_print.css" rel="stylesheet" type="text/css" media="print" /]

it currently misses the other two

[link href="/_styles/dwp-menulesspage.css" rel="stylesheet" type="text/css" media="screen" /]
[link href="/_styles/media.css" rel="stylesheet" type="text/css" media="screen" /]


the code is listen here, is it my regular expression or is it the vb.net code
thats wrong?


Dim sourcestring As String = sInput
Dim re As Regex = New Regex("[link href=""/_styles/[_|][A-Za-z\-]{1,150}.[A-Za-z]{3}"" rel=""stylesheet"" type=""text/css"" media=""[A-Za-z]{4,8}"" /]")
Dim mc As MatchCollection = re.Matches(sourcestring)
For Each m As Match In mc
MsgBox(m.Groups(0).ToString)
sMatchContent = m.Groups(0).ToString
Next