regex options

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do you set multiple options on a regular expresion ?

I have the following code, and I would like to have both run w/ the compiled option, but the (Optioni==TRUE) version needs to ingore case. is there a way to do this ?


if (Optioni)
{
RegexPattern=new Regex(Pattern,RegexOptions.IgnoreCase);
}
else
{
RegexPattern=new Regex(Pattern,RegexOptions.Compiled);
}
 
RegexPattern=new Regex(Pattern,RegexOptions.IgnoreCase |
RegexOptions.Compiled);

Bas Hamer said:
how do you set multiple options on a regular expresion ?

I have the following code, and I would like to have both run w/ the
compiled option, but the (Optioni==TRUE) version needs to ingore case. is
there a way to do this ?
if (Optioni)
{
RegexPattern=new Regex(Pattern,RegexOptions.IgnoreCase);
}
else
{
RegexPattern=new Regex(Pattern,RegexOptions.Compiled);
}
 

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 1
Regex help needed 1
Regex to retain only the HTML body 1
Regex performance issue 6
Regex issue 5
Regex woes 8
How to get rid of the regex???? 6
How to math multiline using C#? 1

Back
Top