You cannot use backreference inside a character class, because a character class matches exactly one character, and a backlink can potentially match any number of characters or no one.
What you are trying to do requires a negative review, not a negative character class:
preg_match_all('/__\(([\'"])(?:(?!\1).)+\1\)/',
"__('match this') . 'not this'", $matches);
- \'|" - - [\'"] - , , .
EDIT: , " " . . RegexBuddy.
abababdedfg,
^[a-g]+$ ,
^(?:a|b|c|d|e|f|g)+$ 55 .
. abababdedfz,
^[a-g]+$ 21 ;
^(?:a|b|c|d|e|f|g)+$ 99 .
, . , , , . .