J
Jerry J
I want to use the Regular Expressions MatchCollection to match multiple
patterns
in a string. I want to match the pattern that looks like "Word, Word".
Using the test code below I would want my match collection to contain
"Field1a, Field1b" and "Field3a, Field3b", but I can't get it to work. Can
someone show me the pattern I need to use?
Dim sString As String = """Field1a, Field1b"", Field2, ""Field3a, Field3b"",
Field4"
Dim sPattern As String = """[\S ]*,[\S ]*"""
Dim reg_exp As New Regex(sPattern)
Dim matches As MatchCollection = reg_exp.Matches(sString)
patterns
in a string. I want to match the pattern that looks like "Word, Word".
Using the test code below I would want my match collection to contain
"Field1a, Field1b" and "Field3a, Field3b", but I can't get it to work. Can
someone show me the pattern I need to use?
Dim sString As String = """Field1a, Field1b"", Field2, ""Field3a, Field3b"",
Field4"
Dim sPattern As String = """[\S ]*,[\S ]*"""
Dim reg_exp As New Regex(sPattern)
Dim matches As MatchCollection = reg_exp.Matches(sString)