Okay, lets say I have a string "The cat in the hat dog", and I know want to regex match cat and dog from the same string.
So I have something like:
Dim myString As String = "The cat in the hat dog"
Dim regex = New Regex("\bcat\b.*\bdog")
Dim match = regex.Match(myString)
If match.Success Then
Console.WriteLine(match.Value)
End If
The match.Value returns "cat in the hat dog", which is expected.
But what I really need is to just "cat dog" without the other words in the middle, and I'm stuck.
Thanks for any help!
If it helps, the string I'm trying to parse is something like "Game Name 20_03 Starter Pack r6" and I'm trying to pull "20_03 r6" out as version information. Currently using "\b\d{2}_\d{2}\b.\br\d" as my regex string.