Hi All,
I’m hoping someone can help me with the correct RegEx search string to achieve the following. For example, I have in a TextField the text “Cat, Dog, Mouse”. I’m trying to create a RegEx search string that will return a positive match only if Cat and Mouse are found.
Example Text
“Cat, Dog, Mouse”
I’ve tried the following code.
[quote]Dim rg As New RegEx
Dim myMatch As RegExMatch
rg.SearchPattern = “Cat” + “|” + “Mouse”
myMatch = rg.Search(InputTextArea.Text)
If myMatch <> Nil Then
'StatusTextField.Text = myMatch.SubExpressionString(0)
StatusTextField.Text = “SUCCEEDED”
Else
StatusTextField.Text = “Text not found!”
End If
Exception err As RegExException
MsgBox(err.Message)
[/quote]
However this seems to return results if Cat or Mouse is found. I’m trying to return a positive result only if Cat and Mouse are found.
Any help appreciated.
Thank you.