Martin Cooke Martin Cooke - 1 year ago 56 Question find occurrences of dot number dot

Should be a real quick one this for those who are good with regex etc, I have some strings and I want to only extract those where it has a dot then a single number between 0-9 and finally another dot. As such:

string2.string = no good

string.1.string = match

strstr.9.strstr = match

str3.-3.str = no good


Answer Source

Try this:



And the VB code:

Dim input = "string.1.string"
Dim pattern = "\.\d\."
Dim matches = Regex.Match(input, pattern).Success