Regular Expression

  • Thread starter Thread starter VJ
  • Start date Start date
V

VJ

I need to use RegEx to check and see if a string does not contain a set of
characters, say "< > ? / $ #"
How would I do this??.

VJ
 
Hi,

Try something like this

Dim rgx As New System.Text.RegularExpressions.Regex("[<>#$?/]")



Trace.WriteLine(rgx.IsMatch("This is a test >"))

Trace.WriteLine(rgx.IsMatch("This is another test <"))

Trace.WriteLine(rgx.IsMatch("/ This is another test"))

Trace.WriteLine(rgx.IsMatch("# This is another test"))

Trace.WriteLine(rgx.IsMatch("This is another test ?"))



Ken

------------------

I need to use RegEx to check and see if a string does not contain a set of
characters, say "< > ? / $ #"
How would I do this??.

VJ
 

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

Back
Top