Hi Ron,
Thank you for using the community. AS I understand, you want a Regular
Expression which can find a string including a special work, but excluding
another word. In Regular Expression, there isn't pattern for "not match".
Normally, we can perform this with two Regular Expression, for example:
Dim re1 As New System.Text.RegularExpressions.Regex("abc")
Dim re2 As New System.Text.RegularExpressions.Regex("def")
Dim s1 As String = "abcdef"
Dim s2 As String = "123abc"
If re1.IsMatch(s1) And (Not re2.IsMatch(s1)) Then
MsgBox(s1 & " is matched")
End If
If re1.IsMatch(s2) And (Not re2.IsMatch(s2)) Then
MsgBox(s2 & " is matched")
End If
Hope this help,
Luke
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)