The problem is that you're using a hyphen "
-" in the middle of a character set "
[(-_]". When used between two characters in a character set, "
-" defines a range for all characters between the codepoints (ASCII numbers) of the two characters. In your case it's between "
(" (codepoint: 40) and "
_" (codepoint: 95), meaning all characters with codepoints between 40-95 will be matched (the number 5 happens to be codepoint 53).
The solution is simple: put the "
-" at the end of the character set so that it's clear it isn't meant to define a range.
$regex($1,/([(_-][A-Z]{2}[-_)])/g)