正则表达式不区分大小写

Regex is used given text according to different and flexible patterns. It provides a lot of different patterns which can match given text or line. The default behavior of the regex is case sensitive which means upper and lowercase letters are interpreted as different. We can match regex case insensitive or ignore case sensitivity.

正则表达式根据不同灵活的模式使用给定的文本。 它提供了许多可以匹配给定文本或行的不同模式。 正则表达式的默认行为区分大小写,这意味着大写和小写字母被解释为不同。 我们可以匹配不区分大小写的正则表达式,也可以忽略大小写。

不区分大小写作为Grep选项 (Case Insensitive As Grep Option)

grep is very popular tool which is used to filter given text with different patterns. grep command also supports Regex or regular expressions and run regex as case sensitive by default. We can disable case-sensitive match with the -i option.

grep是非常流行的工具,用于过滤具有不同模式的给定文本。 grep命令还支持正则表达式或正则表达式,并且默认情况下以区分大小写的方式运行正则表达式。 我们可以使用-i选项禁用区分大小写的匹配。

$ grep -i "poftut" hostnames

Case Insensitive As Grep Option
不区分大小写作为Grep选项

不区分大小写作为正则表达式选项(Case Insensitive As Regular Expression Option)

Regex language also provides an opportunity to make given regex pattern to be case insensitive. We can use (?i) which means the given regex will be case insensitive.

正则表达式语言还提供了使给定的正则表达式模式不区分大小写的机会。 我们可以使用(?i) ,这意味着给定的正则表达式将不区分大小写。

poftut(?i)

Java (Java)

In Java programming language we can use Pattern class which can use Regex and provide CASE_INSENSTIVE as an option. In this example, we will create a Regex pattern named patter which will be case insensitive.

在Java编程语言中,我们可以使用Pattern类,该类可以使用Regex并提供CASE_INSENSTIVE作为选项。 在此示例中,我们将创建一个名为patter的正则表达式模式,该模式不区分大小写。

Pattern pattern = Pattern.compile("poftut", Pattern.CASE_INSENSITIVE);

不区分大小写作为正则表达式 (Case Insensitive As Regular Expression)

Regular expressions also support different patterns to specify numbers letters, upper case letters, lower case letters etc. We can combine upper and lower case letters. [a-z] means lowercase letters and [A-Z] means upper case letters. We can create case insensitivity like below from both upper and lower case letters.

正则表达式还支持不同的模式来指定数字字母,大写字母,小写字母等。我们可以将大写和小写字母组合在一起。 [az]表示小写字母, [AZ]表示大写字母。 我们可以通过大小写字母在下面创建不区分大小写的代码。

[a-zA-Z]
.ucb80e1b2913281d302beedfa82081505 , .ucb80e1b2913281d302beedfa82081505 .postImageUrl , .ucb80e1b2913281d302beedfa82081505 .centered-text-area { min-height: 80px; position: relative; } .ucb80e1b2913281d302beedfa82081505 , .ucb80e1b2913281d302beedfa82081505:hover , .ucb80e1b2913281d302beedfa82081505:visited , .ucb80e1b2913281d302beedfa82081505:active { border:0!important; } .ucb80e1b2913281d302beedfa82081505 .clearfix:after { content: ""; display: table; clear: both; } .ucb80e1b2913281d302beedfa82081505 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ucb80e1b2913281d302beedfa82081505:active , .ucb80e1b2913281d302beedfa82081505:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ucb80e1b2913281d302beedfa82081505 .centered-text-area { width: 100%; position: relative; } .ucb80e1b2913281d302beedfa82081505 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ucb80e1b2913281d302beedfa82081505 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ucb80e1b2913281d302beedfa82081505 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ucb80e1b2913281d302beedfa82081505:hover .ctaButton { background-color: #E67E22!important; } .ucb80e1b2913281d302beedfa82081505 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ucb80e1b2913281d302beedfa82081505 .ucb80e1b2913281d302beedfa82081505-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ucb80e1b2913281d302beedfa82081505:after { content: ""; display: block; clear: both; }

LEARN MORE  What Is Wildcard Character(s)?

.ucb80e1b2913281d302beedfa82081505 , .ucb80e1b2913281d302beedfa82081505 .postImageUrl , .ucb80e1b2913281d302beedfa82081505 .centered-text-area { min-height: 80px; position: relative; } .ucb80e1b2913281d302beedfa82081505 , .ucb80e1b2913281d302beedfa82081505:hover , .ucb80e1b2913281d302beedfa82081505:visited , .ucb80e1b2913281d302beedfa82081505:active { border:0!important; } .ucb80e1b2913281d302beedfa82081505 .clearfix:after { content: ""; display: table; clear: both; } .ucb80e1b2913281d302beedfa82081505 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ucb80e1b2913281d302beedfa82081505:active , .ucb80e1b2913281d302beedfa82081505:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ucb80e1b2913281d302beedfa82081505 .centered-text-area { width: 100%; position: relative; } .ucb80e1b2913281d302beedfa82081505 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ucb80e1b2913281d302beedfa82081505 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ucb80e1b2913281d302beedfa82081505 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ucb80e1b2913281d302beedfa82081505:hover .ctaButton { background-color: #E67E22!important; } .ucb80e1b2913281d302beedfa82081505 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ucb80e1b2913281d302beedfa82081505 .ucb80e1b2913281d302beedfa82081505-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ucb80e1b2913281d302beedfa82081505:after { content: ""; display: block; clear: both; }

了解更多什么是通配符?

翻译自: https://www.poftut.com/how-to-create-case-insensitive-regex/

正则表达式不区分大小写

正则表达式不区分大小写_如何创建不区分大小写的正则表达式?相关推荐

  1. java正则表达式所有字符串_如何在Java中使用正则表达式打印字符串的所有字符?...

    元字符"." 匹配所有字符,以使用正则表达式打印所有字符-使用compile()方法编译正则表达式. 使用matcher()方法创建Matcher对象. 使用find()方法找到匹 ...

  2. java正则表达式 密码强度_密码验证,密码强度正则表达式

    当用户登录网站时,一般要求用户提供登录该网站的用户名称和密码.从某种意义上说,密码的复杂程度越高,用户的信息安全性越高.因此,很多网站在注册用户信息或修改用户密码时,往往会提供一个密码强度的说明,从而 ...

  3. java 正则表达式 判断 日期_怎么在java中利用正则表达式对时间日期进行判断

    怎么在java中利用正则表达式对时间日期进行判断 发布时间:2020-12-08 16:18:34 来源:亿速云 阅读:105 作者:Leah 这篇文章给大家介绍怎么在java中利用正则表达式对时间日 ...

  4. java 正则表达式 单引号_单引号之间的Java正则表达式内容

    guido.. 14 这应该做的伎俩: (?:^|\s)'([^']*?)'(?:$|\s) import java.util.*; import java.lang.*; import java.u ...

  5. mysql表名不区分大小写_设置mysql表名不区分大小写

    查看mysql版本: [root@localhost logs]# mysql -V mysql Ver14.14 Distrib 5.6.37, for linux-glibc2.12 (x86_6 ...

  6. java源程序中区分大小写_Java程序中不区分大小写字母。( )_学小易找答案

    [单选题]下列选项中,不属于Java语言特点的一项是( ) [单选题]丝绸时髦了,人造纤维过时了. [单选题]<葛生>出自<诗经>的: [多选题]keyshot渲染的光源是利用 ...

  7. 正则表达式里转义字符_五分钟搞定正则表达式,如果没搞定,再加两分钟

    五分钟搞定正则表达式,如果没搞定,再加两分钟 [这是 ZY 第 18 篇原创文章] 文章概览 一.正则表达式介绍 正则表达式,又称规则表达式.(英语:Regular Expression,在代码中常简 ...

  8. 正则表达式 任意数字_作为运维还不会正则表达式?赶快看这篇学习一下

    概述 正则表达式是很多运维薄弱的一项技能.大家很多时候都会觉得正则表达式难记.难学.难用,但不可否认的是正则表达式是一项很重要的技能,所有今天将学习和使用正则表达式时的关键点整理如下,仅供参考. 什么 ...

  9. Apollo 对表名区分大小写 如何配置MYSQL不区分大小写呢

    背景 在虚拟机上装apollo的时候发现Mysql数据库ApolloPortalDB和ApolloConfigDB都创建好了,但是启动apollo的服务的时候报错: Table 'ApolloConf ...

最新文章

  1. Linux core dump的详细介绍及使用
  2. wxWidgets:wxArchiveIterator类用法
  3. js中null和undefined
  4. WPF Treeview第三层横向排列
  5. 2021年高考成绩查询山东德洲,2021年德州高考状元是谁分数多少分,历年德州高考状元名单...
  6. 一文搞定Linux环境下线程编程,这些东西老师也不会教你。(史上最详细的线程攻略)
  7. nginx部署vue前端,刷新出现404或者500错误的解决方案
  8. border做三角符号
  9. matlab 曲线收敛,BP神经网络学习曲线收敛问题
  10. [XMAN2018排位赛]AutoKey
  11. linux两个邮件服务,Linux系列-Red Hat5平台下的Postfix邮件服务搭建(二)
  12. Windows10优化系统,优化达到30多项,速度大幅提升,
  13. pycharm使用ssh连接服务器(ubuntu)跑代码报错:“sudo+ssh: ……bash: line 0: cd: xxx/code: No such file or directory”
  14. 【CSS】955- 你该知道的字体 font-family
  15. MySQL数据库应用与管理
  16. mybatis spring springMVC
  17. 【雯女遭TVB封杀没剧拍】
  18. Windows和Linux系统下的共享文件夹配置
  19. 前端歌谣的刷题之路-第六题-加粗文字
  20. 移动云Mas最稳定的发送方式

热门文章

  1. 如何测量两组汇编指令的执行效率
  2. 公司短信平台上的2万块钱,瞬间就被黑光了
  3. numpy如何对txt文件读取_NumPy——文件读取与写入
  4. 【元宇宙经济学】元宇宙经济的四要素
  5. 几何畸变的类型_halcon图像畸变 论述遥感数字图像畸变类型及其产生的原因
  6. 微信小程序 手写签名_微信小程序实现电子签名功能
  7. springboot2 集成shiro-spring-boot-web-starter
  8. 世界杯决赛倒计时,你最看好谁
  9. 分享一下 软件测试面试历程和套路,真的很实在
  10. 后羿采集器怎么导出数据_后羿SEO:如何用后羿采集器查收录?(附详细步骤图)...