I have a string representing cards in a deck, i.e. 7c9hQsKsAs
Is it possible to use Regex to specify .*x.*x.*x.*x.*x where x would specify any character (c/h/d/s) as long as the character is the same character throughout? This would be used to determine if there was a flush.
This would be used to determine if the given cards make a specific poker hand. I've considered sorting by value and suit however I would still need to specify that all suit characters are the same (i.e. value and suit sorted TcJcQcKcAd would be a royal flush).