且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使正则表达式匹配大小写?

更新时间:2023-02-15 17:50:44

如果您希望正则表达式不区分大小写,请添加 i

If you want a regular expression to be case-insensitive, add a i modifier to the end of the regex. Like so:

/[A-Z]{3}([0-9]{1,4})?|[A-Z]{1,3}/i