Skip to content

Instantly share code, notes, and snippets.

@bennadel
Last active March 22, 2020 09:48
Show Gist options
  • Save bennadel/9751807 to your computer and use it in GitHub Desktop.
Save bennadel/9751807 to your computer and use it in GitHub Desktop.
Case Insensitive Java Regular Expressions - How Did I Miss That!?!
<!--- Set string value. --->
<cfset strText = "Libby is FUNNY" />
<!--- Check case-sensitive match. --->
#strText.Matches( "[a-z ]+" )#
<!--- Check case-INsensitive match. --->
#strText.Matches( "(?i)[a-z ]+" )#
<!--- Only allow case-INsensitivity on LIBBY and FUNNY. --->
#strText.Matches( "(?i:libby)[a-z ]+(?i:funny)" )#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment