Non matching regex?

G

Guest

Anyone knows how to create a regex expression that matches all strings not
containing a specific word?
I thought the following would work but i dows not.

Dim TestRegex As Regex = New Regex("(?!exp).*")
Dim S As String = "exp"

Dim M As Match = TestRegex.Match(S)

If M.Success Then
Debug.Write("Match")
Else
Debug.Write("No Match")
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Regular Expression question 5
match a blank line with RegEx 5
regex 3
RegEx for \x### 2
Need help with regex 2
Another question about regex (not understanding) 5
Regex help needed 1
Regex - Matching URLS 2

Top