The
-P
isn't necessary - in fact you should use the flag that corresponds to the flavor of regex you intend to test for - -P
is perl, '-E` is extended, for example.