regex to check string is certain length

Posted by Aly on Stack Overflow See other posts from Stack Overflow or by Aly
Published on 2010-03-21T11:55:27Z Indexed on 2010/03/21 12:01 UTC
Read the original article Hit count: 537

Filed under:
|
|

Hi,

I am trying to write a regex to match pairs of cards (AA, KK, QQ ... 22) and I have the regex ([AKQJT2-9])\1. The problem I have is that this regex will match AA as well as AAbc etc. Is there a way to write the regex such that I can specify I want to match ([AKQJT2-9])\1 and only that (i.e. no more characters after).

Thanks

© Stack Overflow or respective owner

Related posts about regex

Related posts about pair