RegEx: Adding Case Insensitivity to Existing Expression

  • Thread starter Thread starter Guadala Harry
  • Start date Start date
G

Guadala Harry

How can I make the following RegEx expression case-insensitive?

Regex r = new Regex("({SomeValue:.+?}|{OtherValue:.+?})");

So that it would match, for example, on
"somevalue", "sOmEVAluE", "OTHERVALUE", "OthERvAlUE" and so on...

Thanks!
 
Guadala Harry said:
How can I make the following RegEx expression case-insensitive?

Regex r = new Regex("({SomeValue:.+?}|{OtherValue:.+?})");

So that it would match, for example, on
"somevalue", "sOmEVAluE", "OTHERVALUE", "OthERvAlUE" and so on...

Regex r = new Regex("({SomeValue:.+?}|{OtherValue:.+?})",
RegexOptions.IgnoreCase);
 

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