I want to match strings like AhKsand AdKs(i.e. two cards Ah = Ace of Hearts). I want to combine two cards outside the game with a regular expression, what I have now "^[AKQJT2-9][hscd]{2}$", but this may coincide with such hands as AhKh(fits) and AhAh. Is there a way to use backlinks to say that the second [hscd]cannot be the same as firs (similar for [AKQJT2-9])
source
share