Skip to main content
added 8 characters in body
Source Link

I would like to place a RegEx Code in PHP code to validate a passwordplace a RegEx Code in PHP code to validate a password. Example below of current code:

if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) {
    $errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6);
}

I would like to replace the array(6)array(6) with this regular expression with preg_matchpreg_match:

preg_match("/(?=.*[\d])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&])[0-9a-zA-Z!@#$%^&]{10,16}/", $input_line, $output_array);

I would like to place a RegEx Code in PHP code to validate a password. Example below of current code:

if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) {
    $errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6);
}

I would like to replace the array(6) with this regular expression with preg_match:

preg_match("/(?=.*[\d])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&])[0-9a-zA-Z!@#$%^&]{10,16}/", $input_line, $output_array);

I would like to place a RegEx Code in PHP code to validate a password. Example below of current code:

if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) {
    $errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6);
}

I would like to replace the array(6) with this regular expression with preg_match:

preg_match("/(?=.*[\d])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&])[0-9a-zA-Z!@#$%^&]{10,16}/", $input_line, $output_array);
deleted 8 characters in body
Source Link
Marius
  • 198.5k
  • 55
  • 424
  • 833

I would like to place a RegEx Code in PHP code to validate a password. Example below of current code:

if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) {
        $errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6);
    }

I would like to replace the array(6) with this regular expression with preg_match:

preg_match("/(?=.*[\d])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&])[0-9a-zA-Z!@#$%^&]{10,16}/", $input_line, $output_array);

I would like to place a RegEx Code in PHP code to validate a password. Example below of current code:

if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) {
        $errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6);
    }

I would like to replace the array(6) with this regular expression with preg_match:

preg_match("/(?=.*[\d])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&])[0-9a-zA-Z!@#$%^&]{10,16}/", $input_line, $output_array);

I would like to place a RegEx Code in PHP code to validate a password. Example below of current code:

if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) {
    $errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6);
}

I would like to replace the array(6) with this regular expression with preg_match:

preg_match("/(?=.*[\d])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&])[0-9a-zA-Z!@#$%^&]{10,16}/", $input_line, $output_array);
edited tags
Link
Source Link
Elvis
  • 355
  • 1
  • 2
  • 13
Loading