I don't know what script is this but the regex seems to do what it is intended to do. I think it isn't broken.
Maybe the problem is with the subject: $result[0] which doesn't contain the needed string?