because the pStyle varies, you would need to make a new regex pattern for each line with that code.
you could do this also, which would avoid the pStyle issue...
Code:'/// this pattern will search for the { and the stuff between and the } Dim strPattern As String = Regex.Escape("{") & "(.*)}" Dim strToSearch As String = "#pStyle03X0 {XXX: 0px;YYYY: 144px;xxxxx:XXXXX: 1000;xxxxx: 498.00; xxxxx:714.00; }" Dim rgx As New Regex(strPattern, RegexOptions.IgnoreCase) Dim strResult As String = String.Empty '/// this will trim the {} off each match as it's found... Dim charsToTrim As Char() = {"{", "}"} Dim rgxMatches As MatchCollection = rgx.Matches(strToSearch) For Each m As Match In rgxMatches strResult &= m.Value.Trim(charsToTrim) & Environment.NewLine Next MessageBox.Show(strResult)





Reply With Quote