Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

This is my regular expression:
string pattern = @"<(ul|ol)>(<li>.*?</li>)+?</\1>";


How to write regular expression for Case-Insensitive?


Thanks in advance
Posted
Updated 6-Jan-11 21:54pm
v2
Comments
Dalek Dave 7-Jan-11 3:54am    
Edited for Readability.

Regular Expression is by default case-sensitive(A class Regex).

In case you want to make it case-insensitive then you can apply RegexOptions.IgnoreCase at a costructor side of regex.

like

Regex regex = new Regex(@"AbC",RegexOptions.IgnoreCase);


See various propertied on regex HERE[^].
 
Share this answer
 
Dear Friend
You Can use this

^\s*[a-zA-Z,\s]+\s*$


There is a site dedicated to Regular Expression. Its worth bookmarking.
 
Share this answer
 
Expresso - A Tool for Building and Testing Regular Expressions[^]
You can also check out this tool. Its really cool.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900