I've got a project where I'd like to replicate some of the internal merge field functionality so users can build a link and it'd be really helpful if I could do a case-insensitive string replaceAll.
For example, if I want to replace {!id}
or any of it's case variations I could do
return input.replaceAll('\\{![iI][dD]}\\', value);
While I can make do with creating a function to built a regex for any particular input pattern (nevermind the potential issues with script statements) it'd be great if I could emulate how sed
works (the 'i' indicates case insensitive). For example:
sed 's/\{!id\}/replacement/i' inputfile.txt
Anyone have any tips on how to accomplish this?