In JavaScript, this regex:
/^\(.*$/m
matches a complete string if it starts with a (. If the string has
embedded line breaks, it matches the first line in the multi-line
string that starts with a (
This regex:
(/^\(/m
matches ( at the start of a line.
The RegexBuddy source code snippet shown above returns true/false
depending on whether a match can be found within the string.
regexplanet.com does find the match. You have to look at the find()
column. matches() is a Java fuction that requires the regular
expression to match the whole string. Don't do your testing with a
Java regex tester when using JavaScript.
If these regexes aren't working, the problem is elsewhere in your code.