RegEx in JS to find No 3 Identical consecutive characters
问题 How to find a sequence of 3 characters, 'abb' is valid while 'abbb' is not valid, in JS using Regex (could be alphabets,numerics and non alpha numerics). This question is a variation of the question that I have asked in here : How to combine these regex for javascript. This is wrong : /(^([0-9a-zA-Z]|[^0-9a-zA-Z]))\1\1/ , so what is the right way to do it? 回答1: This depends on what you actually mean. If you only want to match three non-identical characters (that is, if abb is valid for you),