Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Another Regular Expressions Question

I've referenced the DLL, added the Regex class as a member of my class, but
when I try to construct it just prior to usage, I get an invalid argument
exception. I am passing a string like "*.dsp" to the constructor. Any ideas
what might set it off?

Thanks!

James White
jamesw@avi.com
[322 byte] By [James White] at [2007-11-9 18:21:52]
# 1 Re: Another Regular Expressions Question
The string you are asking is invalid for a regular expression. Regex does
not look like wildcards...

Try "(.+)\.dsp" as a string, which matches:

(.+) - match any character one or more times
\. - match "." (have to use \ to escape it)
dsp - match this verbatim

"James White" <jamesw@avi.com> wrote in message
news:39aff7b6@news.dev-archive.com...
> I've referenced the DLL, added the Regex class as a member of my class,
but
> when I try to construct it just prior to usage, I get an invalid argument
> exception. I am passing a string like "*.dsp" to the constructor. Any
ideas
> what might set it off?
>
> Thanks!
>
> James White
> jamesw@avi.com
>
>
Eric Gunnerson at 2007-11-11 22:28:58 >