Skip to content

Instantly share code, notes, and snippets.

@yuanliwei
Created December 10, 2015 10:11
Show Gist options
  • Save yuanliwei/9d7f77a692c51f91c514 to your computer and use it in GitHub Desktop.
Save yuanliwei/9d7f77a692c51f91c514 to your computer and use it in GitHub Desktop.
java 正则表达式忽略大小写

java 正则表达式忽略大小写

  • (?i)打开正则表达式忽略大小写开关
  • (?-i)关闭打开正则表达式忽略大小写开关
"ABc".matches("(?i)abc");//true 
"ABc".matches("(?i)a(?-i)bc");//false 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment