preg match for repeating or incremental characters
问题 I am using preg match to validate password as: (preg_match("/^.*(?=.{5,}).*$/", $password) which accept special characters too. but for some reason, i need to modify it which should accept only alphanumeric minimum 5 characters long and very important that it must not have any repeating or incremental characters like: aaaa or 12345 or abc123 etc . 回答1: if (preg_match( '%^ # Start of string (?!.*(.)\1) # Assert no repeated characters # Assert no sequential digits/characters (?!.*(?:01|12|23|34