Hi,
can anyone help me to find this regex pattern for this string
<proj soc=”TTL-UY, GPL-UY” topo=”LTeGHG, CAR-UY”>
I'm want to match a string embedded in double quotation marks
output : TTL-UY, GPL-UY
LTeGHG, CAR-UY
Printable View
Hi,
can anyone help me to find this regex pattern for this string
<proj soc=”TTL-UY, GPL-UY” topo=”LTeGHG, CAR-UY”>
I'm want to match a string embedded in double quotation marks
output : TTL-UY, GPL-UY
LTeGHG, CAR-UY
If the string is simple " quotes then
should work as a regex to match what is between the quotes.Code:".+?"
Try this...
Code:Imports System.Text.RegularExpressions
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim s As String = "<proj soc=""TTL-UY, GPL-UY"" topo=""LTeGHG, CAR-UY"">"
Dim matches() As Match = Regex.Matches(s, "(?<="")[A-Za-z\-(,\s)]+?(?="")").Cast(Of Match).ToArray
MsgBox(String.Join(Environment.NewLine, Array.ConvertAll(matches, Function(m) m.Value)))
End Sub
End Class