Regular Expression

  • Thread starter Thread starter Mac McMicmac
  • Start date Start date
M

Mac McMicmac

I'm implementing a RegularExpressionValidator and need assistance with the
value to put into the ValidationExpression property. The control needs to
validate a textbox that must contain a complete file path. I know these
things can get pretty complex - so I'd be happy to keep it simple by having
the expression simply verify the text entered into the textbox ends with
..doc, .wav, or .pdf. If it's not too much to ask, I'd like for the
expression to ensure that there is at least one \ and at least one character
preceding any of the three extensions listed (.doc, .wav. .pdf).

Thanks.
 
Mac said:
I'm implementing a RegularExpressionValidator and need assistance with the
value to put into the ValidationExpression property. The control needs to
validate a textbox that must contain a complete file path. I know these
things can get pretty complex - so I'd be happy to keep it simple by having
the expression simply verify the text entered into the textbox ends with
.doc, .wav, or .pdf. If it's not too much to ask, I'd like for the
expression to ensure that there is at least one \ and at least one character
preceding any of the three extensions listed (.doc, .wav. .pdf).

Thanks.

Mac,

Start with this regex and modify the end part for each of the file
extensions you need (.txt, .doc, .wav, etc.).

http://www.regexlib.com/REDetails.aspx?regexp_id=137

Darrell
http://dotnetjunkies.com/WebLog/darrell.norton/
 

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


Back
Top