当前位置:网站首页>JS regular ignore case
JS regular ignore case
2022-06-23 20:34:00 【It workers】
js When writing a regular , By default, regular is case sensitive .
for example :
var str = 'HelloWorld'; var reg = /h/g; reg.test(str); // return false
We can use i To ignore case , The grammar is as follows :
/regex/i
The above code is modified as follows :
var str = 'HelloWorld'; var reg = /h/gi; reg.test(str); // return true
following , Let's use the regular modifier i, It's solved js Regular ignore case .
Regular in real projects , Although not used very much , But master the regularity , At the critical moment , But you can get twice the result with half the effort , Common implementations are as follows : Replace string 、 obtain url Parameters, etc. .
边栏推荐
- The "open source star picking program" container pulls private images from harbor, which is a necessary skill for cloud native advanced technology
- Zabbix监控- Aruba AP运行数据
- How is the picture mosaic clear? What is mosaic for?
- [golang] how to clear slices gracefully
- 20 provinces and cities announce the road map of the meta universe
- 【Golang】快速复习指南QuickReview(一)——字符串string
- 【Golang】快速复习指南QuickReview(八)——goroutine
- Postman tutorial - teach you API interface testing by hand
- Is Huishang futures trading software formal? How to download safely?
- 怎么开户?在国海证券开户安全吗?需要带什么?
猜你喜欢

Hardware development notes (6): basic process of hardware development, making a USB to RS232 module (5): creating USB package library and associating principle graphic devices

Can the biggest gamefi crash victim survive the bear market in May| May Monthly Report

八大误区,逐个击破(终篇):云难以扩展、定制性差,还会让管理员失去控制权?

80% of people will be wrong about the three counter intuitive questions?

Yaokui tower in Fengjie, Chongqing, after its completion, will be the safety tower for Sichuan river shipping with five local scholars in the company

Check four WiFi encryption standards: WEP, WPA, WPA2 and WPA3

I came from a major, so I didn't want to outsource

Elastricearch's fragmentation principle of the second bullet

LeetCode 1079. movable-type printing

FPGA based electromagnetic ultrasonic pulse compression detection system paper + source file
随机推荐
Add two factor authentication, not afraid of password disclosure, let alone 123456
[golang] how to clear slices gracefully
Is Guoyuan futures trading software formal? How to download safely?
Development of block hash quiz game system (DAPP)
Rendering of kotlin jetpack compose tab using animatedvisibility
【Golang】在Go语言的角度重新审视闭包
Leaders of Hangcheng street, Bao'an District and their delegation visited lianchengfa for investigation
The golden nine silver ten, depends on this detail, the offer obtains the soft hand!
【Golang】快速复习指南QuickReview(七)——interface
String Day6 of Li Kou daily practice
Open source SPL redefines OLAP server
How is the picture mosaic clear? What is mosaic for?
[golang] quick review guide quickreview (II) -- slice
ntpupdate. tencentyun. Com has been eliminated
Digital procurement transformation solution: SaaS procurement management platform promotes enterprise sunshine procurement
How to deal with unclear pictures? How to deal with color balance?
Kubernetes resource topology aware scheduling optimization
[golang] quick review guide quickreview (VI) -- struct
【Golang】跟着源码学技巧系列之对象池sync.Pool
20 provinces and cities announce the road map of the meta universe