PHP how to check there are more than 2 running same chars in a string -


checking if string has more running 1 occurrence of same character. iiiiiiii or ssssss. maybe use preg_match pattern should be?

try regex:

$str = 'hello'; print preg_match('/([\w])\1{1,}/', $str); /*return true */ 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -