Non matching regex?

  • Thread starter Thread starter Guest
  • Start date Start date
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 question find words that start with special char 3
regex 3
RegEx for \x### 2
Need help with regex 2
Regex in C# 4
Regex help needed 1

Back
Top