Newbie Regular Expressions

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I want to use the Reg Ex validation control to check whether there are any
apostropes or quotes in a textbox. Can someone help get me started. I have
tried ["'] but it doesn't work. Regards, Chris.
 
Try this regex:

[^"']*

It validates that the string is 0 or more non quote chars.

Jason
 
Perhaps the problem is more complex than I understand, but if I only needed
to see if there is one or more quotes or one or more aponstrophes I would do
this:
Dim xQuote as integer
Dim xApostophe as Integer
xQuote= instr(1,myTextBox.text,chr(34))
xApostrophe=instr(1,myTextBox.text,chr(39))
if xQuote > 0 or xApostrophe > 0 then
msgbox "Entry may not contain quotes or apostorphes."
endif
 

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