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);
 
Back
Top