CASE-INSESITIVE正则表达式...? [英] Regular expression for CASE-INSESITIVE...?

查看:98
本文介绍了CASE-INSESITIVE正则表达式...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这是我的正则表达式:
string pattern = @"<(ul|ol)>(<li>.*?</li>)+?</\1>";


如何编写不区分大小写的正则表达式?


在此先感谢

Hi,

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


How to write regular expression for Case-Insensitive?


Thanks in advance

推荐答案

正则表达式默认情况下区分大小写(A类Regex).

如果要使其不区分大小写,则可以在正则表达式的构造函数侧应用RegexOptions.IgnoreCase.

喜欢

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



请参见正则表达式 HERE [



See various propertied on regex HERE[^].


亲爱的朋友
您可以使用此

Dear Friend
You Can use this

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




有一个专门用于正则表达式的网站.它值得收藏.



There is a site dedicated to Regular Expression. Its worth bookmarking.


这篇关于CASE-INSESITIVE正则表达式...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆