Hello everyone, I have a program that needs to find straights in a hand of cards. The hand is a string with no whitespace sorted by the cards' ranks, eg "9d10cJhQsKd". How can I identify if that hand contains a straight with a single regex? Is that even possible? Is there a way to escape the regex and do addition on a backreference to get something like /(\d+)[cdhs]\1+1[cdhs]\1+2/? Thanks, -Andrew
- escaping regex to do math on backreferences Andrew Fithian
- Re: escaping regex to do math on backreferences Gunnar Hjalmarsson
- Re: escaping regex to do math on backreferences Chas. Owens
- Re: escaping regex to do math on backreference... Gunnar Hjalmarsson
- Re: escaping regex to do math on backrefer... Chas. Owens
- Re: escaping regex to do math on backr... Gunnar Hjalmarsson
- Re: escaping regex to do math on ... Chas. Owens