function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AndrzejWAndrzejW 

Case insensitive regular expressions

Hi All,

 

I have tried to make regular expressions in APEX case insensitive, but I couldn't find any way of doing this. I will appreciate any help with this.

 

Thanks,

 

Andrzej

Best Answer chosen by Admin (Salesforce Developers) 
AndrzejWAndrzejW
I've just found it. The embeded expression (?i) at the beginning of the pattern will make it case insensitive. (?iu) will do the same thing for the Unicode characters.

All Answers

AndrzejWAndrzejW
I've just found it. The embeded expression (?i) at the beginning of the pattern will make it case insensitive. (?iu) will do the same thing for the Unicode characters.
This was selected as the best answer
Scott.MScott.M

Thanks for posting this! I never would of figured it out without this post. This should be added to the apex reference.