There's no function to check if a string is a valid regex, and doing it
via preg_match requires error suppression, often performed with @. This
isn't however a good practice, and suppressing errors via functions is
not a one line solution. Adding an utility function would probably be a
benefit for several use cases (try to grep '@preg_match' for a few of
them).
Change-Id: I257a096319f1ec13441e9f745dcd22545fdd5cc6