Range of Hands Syntax Help
Generic Range Syntax
Generic range syntax is the latest mini-language for describing ranges of poker hands.
It is more powerful and more concise than any of the classic (read 'old') ProPokerTools syntaxes.
Generic Syntax Documentation
Games Supported
Generic Syntax is currently available for all games.
Generic Syntax may also be used to specify the board and dead cards.
Ranks and Suits
- The standard ranks are "AKQJT98765432".
- The standard suits are "shdc".
- Suit variables are "wxyz". See the examples below for how these work.
- All other letters not listed above are rank variables. "R" for Rank, "O" for Other rank, and "N" for aNother rank are reasonable choices. See the examples below for how these work.
- "*" is the wildcard rank, and means "any rank".
Here are some example 4-card (omaha) ranges using only the above:- AsKhJd2c a specific hand where all cards are known.
- AA a hand with at least two aces in it.
- AxAyxy double-suited Aces.
- sshh a hand with two spades and two hearts.
- wxy a hand with at least three suits.
- **** a completely random hand. This can be written more simply as "*".
- RRON A hand with one pair and two non-paired side cards.
- RxRyOxOy A double-suited hand with two pairs in it.
Percent of Hands
ProPokerTools has its own ranking of hands for omaha, omaha hi/lo, hold'em, five-card omaha,
and five-card omaha hi/lo. Here are a few examples of how to generate ranges using these rankings:
- 15% The top 15 percent of hands (full-ring)
- 5%-10% Hands between the top 5 and top 10 percent of hands (full-ring)
- 1%-100% All hands
The default rankings are for full-ring games. Also provided are rankings for 6-handed games.
To specify the 6-handed rankings, simply add "6h" after the percentage sign:
- 15%6h The top 15 percent of hands (6-handed)
- 5%-10%6h Hands between the top 5 and top 10 percent of hands (6-handed)
Text files containing the hand orderings can be downloaded below:
If you are curious about how these orderings were created, you can check out these blog posts:Combining Ranges
There are three ways to combine multiple ranges.
- Use ',' (read as "or") to get the union of two ranges. For instance, in hold'em, "JJ, AK" means "Jacks OR Ace-King."
- Use ':' (read as "and") to get the intersection of two ranges. For instance, in hold'em, "xx:15%" means "hands that are suited AND in the top 15% of hands."
- Use '!' (read as "not") to get the difference of two ranges. For instance, in omaha, "AA!AAA" means "hands with two aces NOT three aces."
Note that all three combinators (",", ":", and "!") can be used together.
For instance, in omaha, "AA:xxyy, JJ!JJJ, KK" means "double suited aces or a hand with exactly
two jacks or a hand with at least two kings."Rank Spans
Rank spans allow you to specify cards that vary from a start rank to an end rank. This is easier explained with a few omaha hand examples:
- KQJT-T987 Equivalent toKQJT,QJT9,JT98,T987
- AAJT-AA87 Equivalent toAAJT,AAT9,AA98,AA87
It is possible to use multiple rank spans in the same hand if they are enclosed in square brackets. For instance:- [A-Q][J-T]23 Equivalent toAJ23, AT23, KJ23, KT23, QJ23, QT23
Furthermore, you can use a trailing plus or minus to indicate ascending or descending ranges:- T8+ Equivalent toT8,J9,QT,KJ,AQ
- 664- Equivalent to664,553,442
Finally, suits and suit variables are allowed, as long as both sides match:- TsJs-KsQs Equivalent toTsJs,JsQs,QsKs
- [Kx-Jx]x Equivalent toKxx, Qxx, Jxx
Rank and Suit Lists
Occasionally, you want to have a card match a particular set of ranks, suits, or cards. Here are some examples:
- [2,3,4] Equivalent to2-4
- [2,4,6,8,T][3,5,7,9] A hand with at least one odd and one even number card.
- [As,Ah,K]K Equivalent toAsK, AhK, KK
Card Order
Card order is preserved for games where the order of cards is significant (stud, stud-8).
Card order is ignored for other games (hold'em, omaha, omaha-8).
Card order is also preserved for flop game boards on the turn and river.
Card order in Stud Games
In seven-card stud, the order of the cards as they come out is significant except in the case
of the first two cards. For instance, "KsJhTd" and "KsTdJh" are NOT considered the same hand.
"KsJhTd" and "JhKsTd" ARE considered the same hand, because the order of the first two cards is
not considered significant. When combining ranges, card order is respected for cards on third-street and beyond.
For instance, "KQJ:xxy" implies a stud hand with a suited king-queen in the hole and an off-suit jack showing
(an equivalent way to write it wold be "KxQxJy").
Card Order in Flop Games
There is no concept of card order in generic range syntax for Hold'em and Omaha. For instance, in Hold'em, "KJ:hd" translates directly to "a hand with a king and a jack AND a hand with a heart and a diamond". As such, it is equivalent to "KhJd, KdJh" - it is NOT the same as "KhJd". Similarly, in Omaha, if one wanted to specify a hand with ace-high flush potential in hearts single-suited, one would write "Ahhxy" - it is NOT correct to write "A:hhxy", as that would include hands such as "AcJs7h6h".
Card Order on Flop Game Boards
For games with a shared board (hold'em, omaha, omaha-8), the order of the first three cards (the "flop") is not significant, while the order of the last two cards (the "turn" and "river") is significant. For instance, the boards "KKJ" and "JKK" are equivalent - they translate to "a flop with two kings and one jack". However, the boards "sshds" and "sshsd" are NOT equivalent - the first board has a flop with two spades and one heart, a diamond on the turn, and a spade on the river, while the second board has the same flop but a SPADE on the turn and a DIAMOND on the river.
Card Counts
For games where the number of cards in a hand is always known (hold'em always has 2 cards, omaha always 4), ranges are always implicitly 'topped off' with wildcards to bring the number of cards up to the correct number. For instance, in omaha, "AA" is equivalent to "AA**", and "KJ:xxy" is equivalent to "KJ**:xxy*".
For stud games, card counts can vary. For stud and stud-8, card counts are brought up to a minimum of three cards, but no other topping-off is performed. For example, "KJ" is equivalent to "KJ*" (because all hands are brought to a minimum size of three). In addition, sub-ranges can only be combined if they have the same number of cards listed. For instance, "KJ84:xxyz" is legal, whereas "KJ84:xx" is not.
No Pair Constraint
You can enclose any number of cards in a subrange in curly braces to indicate that there are no paired cards. For instance:
- A{A$W$W} an omaha hand containg two aces and two non-paired wheel cards
- {$W$W 5s} a stud hand with a wheel draw headed by the five of spades
Special Stud Syntax
The pipe '|' character can be used to delineate separate ranges for portions of a stud hand. For instance:
- AA-TT, ss | Ks A big pair or two spades in the hole and a king of spades showing
- xx:[9-Q][9-Q] | RR | s, K Suited medium-large cards in the hole and a pair showing on fourth street followed by a spade or a king on fifth street
Note that each of the range pieces separated by '|' are completely independent of each other. This means, for instance, that "xx|xx" does NOT mean four suited cards - it means two suited cards in the hole and two suited cards showing.Syntax Macros
Syntax macros are a useful way to avoid typing in the same string of characters over and over again. Macros begin with a $ and may contain numbers and letters. Macros may reference other macros (but no macro may reference itself). The Generic Syntax comes with the following built-in macros:
Macro | Meaning | Games | Translates to | Example |
---|
$s | suited constraint | Hold'em | :xx | AK$s ace-king suited |
$o | off-suit constraint | Hold'em | :xy | JT$o jack-ten off-suit |
$B | big card | All | [A-J] | $B$B two big cards |
$M | middle card | All | [T-7] | $M$M two middle cards |
$Z | small card | All | [6-2] | $Z$Z two small cards |
$L | low card | All | [A,2,3,4,5,6,7,8] | $L$L$L$L!RRRR four cards that can make a low (omaha hi/lo). |
$N | no-low card | All | [K-9] | $N$N$N$N four cards that cannot make a low (omaha hi/lo). |
$F | face card | All | [K-J] | $F$F two face cards |
$R | broadway card | All | [A-T] | $R$R two broadway cards |
$W | wheel card | All | [A,2,3,4,5] | $W$W two wheel cards |
$ds | double-suited constraint | Omaha, Omaha Hi/Lo | :xxyy | AA$ds double-suited aces |
$ss | single-suited constraint | Omaha, Omaha Hi/Lo | :xxyz | AKQJ-9876$ss single-suited medium-to-large rundown (hand has three suits) |
$np | no pairs constraint | Omaha, Omaha Hi/Lo | !RR | 15%$np a hand in the top 15% with no paired cards |
$op | one pair constraint | Omaha, Omaha Hi/Lo | :RRON | 5%$op a hand in the top 5% with exactly one pair (and no trips) |
$tp | two pair constraint | Omaha, Omaha Hi/Lo | :RROO | 20%tp a hand in the top 20% with two pair |
$nt | no trips constraint | Omaha, Omaha Hi/Lo | !RRR | 50%$nt a hand in the top 50% with no trips (or quads) |
$0g | a zero-gap rundown | Omaha, Omaha Hi/Lo | AKQJ- | $0g:10% a zero-gap rundown in the top 10% of hands |
$1g | a one-gap rundown | Omaha, Omaha Hi/Lo | (AKQT-, AKJT-, AQJT-) | $1g:20% a one-gap rundown in the top 20% of hands |
$2g | a two-gap rundown | Omaha, Omaha Hi/Lo | (AKQ9-, AKT9-, AJT9-) | $2g:ss a two-gap rundown with two or more spades |
Weighted Ranges
Weighted ranges are supported for hold'em, omaha, and omaha hi/lo.
Weighted ranges allow you to specify the relative probabilities of hands appearing in a range. For instance, if we want a range where aces and kings are always played but queens are only played half the time, we could write "AA-KK@100,QQ@50".
Click here for more details on weighted ranges
Generic Syntax Odds and Ends
- Case ("A" vs. "a") is ignored. Nevertheless, ranges are easier to read if ranks and rank variables are capitalized while suit variables are in lower case.
- Aces are always high. This means that "A-5" is equivalent to "[A,K,Q,J,T,9,8,7,6,5]". If you want wheel cards, you can use [A,2,3,4,5] instead.
- Suits and suit variables are attached to the rank on their left. If the symbol immediately to the left is not a rank (A, K, ...), rank variable (R, O,...), or wildcard rank (*), then a wildcard rank is implicit. For example, "ss" is equivalent to "*s*s", "KsTsxx" is equivalent to "KsTs*x*x", and "sJhhd" is equivalent to "*sJh*h*d".
- Suit variables will not bind to any suits listed in a range. For instance, "ssxx" means two spades and two cards of some other suit - the 'x' will not assume the value of spades. Similarly, rank variables will not bind to any ranks listed in a range. For instance, "AARR" means aces with another pair - it does not include four aces.
- Parentheses ("(" and ")") have the highest precedence, and can be used for grouping. For instance, "(AK, JT):xx" is equivalent to "AxKx, JxTx".
- Constraints ("!" and ":") have the next highest precedence after parentheses, and are left-associative. For instance, "AK,*:xx!RR" is equivalent to "AK, (*:xx)!RR"
- Commas (",") have the lowest precedence.
Key Differences vs. Classic Syntax
Here are a few quick notes for those of you who have made extensive use of the classic ProPokerTools range of hands syntax:
Hold'em Players
- At long last, hold'em range syntax gets as much expressive power as omaha. Hooray!
- 's' and 'o' no longer mean suited and off-suit. 's' always means spades. If you want a suited hand, you have two options - you can use suit variables ("AxKx" for ace-king suited), or the suited macro ("AK$s"). For offsuit, use "AxKy" or "AK$o".
Omaha Players
- If less than four cards are specified, wildcards ('*') are added for you. Where you used to write "AA**", you can now write "AA". Where a random hand was "****", "*" will now suffice.
- "&" (the "and" combinator) has been replaced with ":". This is partly to avoid confusion with the old syntax, and partly because the colon just feels better.
- Operator precedence has been fixed to match users' expectations. In the old syntax, errors seemed almost more common than correct usage when combining "&", "," and "!". Constraints ("!" ("NOT") and ":" ("AND")) now have high precedence and are left associative. This means that "AK:15%, JT:30%, KQ!Ks" means what it looks like - namely, "ace-king in the top 15% or jack-ten in the top 30% or king-queen without the king of spades". The most common case where you need parentheses in the generic syntax is when you apply a constraint to a number of subranges, such as "(AA, AK):xxyy" for "aces or ace-king double suited".
Stud Players
- Stud now has the same expressiveness as other games.
- There is no longer a limitation that upcards be specific cards (although there is a maximum number of hands allowed in any range).
Extensive Examples
Hold'em Examples
- AsKh Ace of spades and king of hearts
- AA A pair of aces
- AA,KK,AK A pair of aces, a pair of kings, or ace-king
- AxJx Ace-jack suited
- AJ$s Another way to write ace-jack suited
- AxTy Ace-ten off-suit
- AT$o Another way to write ace-ten off-suit
- K*h A hand with any king and another card that is a heart
- * A random hand
- 15% A hand in the top 15% of hands
- 30%-50% A hand between the top 30 and top 50 percent of hands.
- K A hand with a king in it
- ss A hand with two spades in it
- JR A hand with a jack and some other rank
- hx A hand with one heart and one other suit
- TT-77 A medium pair
- Q+ A hand with a queen, king, or ace in it
- [T+][T+] A hand with two broadway cards in it
- A-Q A hand with an ace, a king, or a queen
- [A-J][2-5] A hand with an A, K, Q, or J and a 2, 3, 4, or 5
- K[2s,Jc,T] A hand with a king and a 2 of spades, jack of clubs, or ten
- J[T-] A jack-high hand
- A!AK A hand with an ace but not ace king
- 25%:xx A hand in the top 25% of hands that is suited
- A:15%!AA A hand with an ace in the top 15% of hands but not a pair of aces.
- 40%!AA-22 A hand in the top 40% of hands that is not a pair
- (A, ss):15% An ace or a hand with two spades in the top 15% of hands
Omaha Examples
- AsKhJd2c Ace of spades, king of hearts, jack of diamonds, and two of clubs
- AA A hand with at least two aces
- AA,KK A hand with at least two aces or two kings
- AxAyxy Double-suited aces
- AA$ds Another way to write double-suited aces
- AxAyxz Single-suited aces
- AA$ss Another way to write single-suited aces
- KJ*ss Any king, any jack, and two other cards that are spades
- * A random hand
- 15% A hand in the top 15% of hands
- 30%-50% A hand between the top 30 and top 50 percent of hands.
- K A hand with a king in it
- ss A hand with two spades in it
- JRON A hand with a jack and three other ranks
- RROO A hand with two pairs in it
- hhxx A hand with two hearts and two of some other suit
- TT-77 A hand with at least two tens, nines, eights, or sevens in it
- Q+ A hand with at least one queen, king, or ace
- 9876- A medium to small rundown
- A-Q A hand with an ace, a king, or a queen
- [A-J][2-5]33 A hand with an A, K, Q, or J and a 2, 3, 4, or 5 and two threes
- K[2s,Jc,T] A hand with a king and a 2 of spades, jack of clubs, or ten
- J[T-][T-][T-] A jack-high hand
- *$np A hand with no paired cards
- *$nt A hand with no trips
- AA!AAA A hand with exactly two aces
- AA$nt Another way to write a hand with exactly two aces
- AARR A hand with two aces and another pair (but not four aces)
- {$L$L$L$L} Four non-paired cards that can make a lo
- A!K A hand with an ace but no king
- 25%:wxyz A hand in the top 25% of hands that is monotone
- A:15%!AA A hand with an ace in the top 15% of hands but not a pair of aces.
- 40%!RR A hand in the top 40% of hands with no paired cards
- ([T+][T+][T+], ss):15% At least three big cards or a hand with two spades in the top 15% of hands
- (Ax[2x-5x], 2x3x-2x5x, 3x4x-3x5x, 4x5x):30%-50% A hand with at least two suited wheel cards in the top 30 to 50 percent of hands
Stud Examples
- AsKh2c8h9d Ace of spades and king of hearts in the hole, followed by the two of clubs, eight of hearts, and nine of diamonds.
- AAK Aces in the hole and a king up.
- AA-JJ, dd | 8d A big pair or two diamonds in the hole and the eight of diamonds up
- xxxx A four-flush
- x x Rx x R Flush draw that paired the door-card on fifth street.
- {$L$L 8s6c} A low draw on fourth street with the eight of spades and six of clubs showing
Board Examples
- AsKdJh A flop with the ace of spades, the king of diamonds, and the jack of hearts
- A**!AA* A flop with exactly one ace
- ***![T+]** A flop with no card ten or higher
- RON A flop with no pairs
- RRO A flop with one pair
- 234+ A straight-friendly flop
- RONR A board with no pairs on the flop that paired on the turn
- xyz A rainbow flop
- xxx A monotone flop
Classic Hold'em Range Syntax
The examples below show the set of features available in the Hold'em Range Syntax
AsAh ace of spades and ace of hearts
AA any pair of aces
AA, KK a pair of aces or kings
A* any hand with an ace in it
** any two cards
JTs jack-ten suited
JTo jack-ten off suit
JT any jack-ten
A*s any suited ace
*h*h any two hearts
AA, KK, AK aces, kings, and ace-king
X% The top X% of hands
A5-A2 equivalent to A5,A4,A3,A2
AK-JT equivalent to AK,KQ,QJ,JT
QTs-97s equivalent to QTs, J9s, T8s, 97s
AA-TT, AK, AQ, AJs any pair tens or higher, any ace-king or ace-queen, and ace-jack suited
Classic Omaha Range Syntax
The examples below show the set of features available in the Omaha Range Syntax
AsKsTdTh ace of spades, king of spades, ten of diamonds, and ten of hearts
AA** any hand with at least two aces
AA**, KK** any hand with at least two aces or two kings (',' is the union operator)
** & KK** any hand with two aces AND two kings ('&' is the intersection operator)
AAKK another way of writing the above
15% ! AA** A hand in the top fifteen percent of hands EXCLUDING those with two aces ('!' is the difference operator)
(88**, (99** & *s*s**)) ! 10% Use parentheses for grouping. Operators in ascending precedence order are '&', '!', ',', '()'.
*h*h** any hand with at least two hearts
X% Hands in the Xth percentile or better.
15%-30% A hand in the 15th to 30th percentile
BBMM two big (A,K,Q,J) and two middle (T,9,8,7)
ZZLL two small (6,5,4,3,2) and two low (A,2,3,4,5,6,7,8) cards
NNWW two non-low (K,Q,J,T,9) and two wheel (A,2,3,4,5) cards
AsBsAhBh ace-big of spades and ace-big of hearts
Classic Stud Range Syntax
The examples below show the set of features available in the Stud Range Syntax
* * | Ks any two hole cards and Ks up
*s *s | Ks two spades in hole with Ks up
Js Qs | Ks Js, Qs, Ks
Js Qs Ks Also Js, Qs, Ks - no pipe needed if all cards exact
J Q | Ks any jack and queen with Ks
9+ 9+ | Ks two cards nine or higher with Ks
9+s 9+s | Ks two spades nine or higher with Ks
88-QQ | Ks 88, 99, TT, JJ, or QQ with Ks
22-AA, *s *s| Ks 2c Ts pair, trips, or flush draw on fifth street
22-AA, *s *s| Ks 2c Ts 8h | *d, *h Red card flashed on river
B M | Ks a big (A,K,Q,J) and middle (T,9,8,7) card with Ks
Z L | Ks a small (6,5,4,3,2) and "low" (A,2,3,4,5,6,7,8) card with Ks
N W | Ks a "no-low" (K,Q,J,T,9) and wheel (A,2,3,4,5) card with Ks
Classic Razz Range Syntax
The examples below show the set of features available in the Razz Range Syntax
A35 An Ace, a three, and a five
JJ4 Two Jacks and a four
**6 Two random down cards and a six
9- 9- 4 Two down cards nine or lower and a four
3+ 3+ 9 Two down cards three or higher and a nine
(T- 7- 4) Three DIFFERENT ranks - a ten or lower, a seven or lower, and a four
Use parentheses to force ranks to be all different.
Range of hands currently supported on down cards only (cards one, two, seven).