Does anyone know how to write a Regex.Split in order to convert
{video="my/video/file.flv,my/location.jpg"}
into
- my/video/file.flv
- my/location.jpg
Does anyone know how to write a Regex.Split in order to convert
{video="my/video/file.flv,my/location.jpg"}
into
Like this:
new Regex(@"[{="",}]").Split(@"{video=""my/video/file.flv,my/location.jpg}").Where(s => s.Length > 0)
EDIT: In VB:
Dim regex As New Regex("[{="",}]")
Dim myStr = "{video=""my/video/file.flv,my/location.jpg}"
Dim results = regex.Split(myStr).Where(Function(s) s.Length > 0)
Have you considered using the Split function?
string x = "{video=\"my/video/file.flv,my/location.jpg\"}";
string xx = x.Split(',');
This work around seems to have done the trick for me. Thoughts?
Dim str As String = "this is exciting {video=""my/exciting/video.flv,my/refreshing/image.jpg""} this is refreshing"
Dim regFind As String = "(?'text'\{video=""(.*)\""})"
Dim matcher As Match = Regex.Match(str, regFind)
Dim Matched As String() = (matcher.Groups("text").Value).Split(",")
Dim video As String = Matched(0).Replace("{video=""", "")
Dim jpg As String = Matched(1).Replace("""}", "")
Response.Write(video)
Response.Write("<br />")
Response.Write(jpg)