We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05f4ba0 commit eb9c01bCopy full SHA for eb9c01b
src/DB_Command.php
@@ -820,6 +820,10 @@ public function search( $args, $assoc_args ) {
820
821
if ( ( $regex = \WP_CLI\Utils\get_flag_value( $assoc_args, 'regex', false ) ) ) {
822
$regex_flags = \WP_CLI\Utils\get_flag_value( $assoc_args, 'regex-flags', false );
823
+ // http://php.net/manual/en/reference.pcre.pattern.modifiers.php
824
+ if ( $regex_flags && ! preg_match( '/^(?!.*(.).*\1)[imsxeADSUXJu]+$/', $regex_flags ) ) {
825
+ WP_CLI::error( "Incorrect PCRE modifiers." );
826
+ }
827
$regex_delimiter = \WP_CLI\Utils\get_flag_value( $assoc_args, 'regex-delimiter', '/' );
828
if ( '' === $regex_delimiter ) {
829
$regex_delimiter = '/';
0 commit comments