I'm trying to match a string with Pattern/Matcher, however it is failing because I cannot set Pattern.MULTILINE like the Java documentation uses.
String testString = 'Line 1: Does not match\nCustomer Name: Bob Dole';
String regex = '^\\s*Customer Name\\s*:\\s+(.*)$';
Matcher m = Pattern.compile(regex).matcher(testString);
Boolean hasMatch = m.matches(); //Returns false
According to the Java documentation linked from the Pattern documentation on SFDC this should work:
Matcher m = Pattern.compile(regex, Pattern.MULTILINE).matcher(testString);
However, this gives the error Variable does not exist: Pattern.MULTILINE
Any ideas on how to get multiline working with Pattern?