| integer (3) | Matches a number of characters, and advances that many characters. If negative, matches if not that many characters and does not advance. For example, -1 will match the end of a string |
| `(range "az" "AZ")` | Matches characters in a range and advances 1 character. Multiple ranges can be combined together. |
| `(set "abcd")` | Match any character in the argument string. Advances 1 character. |
| `(choice a b c ...)` | Tries to match a, then b, and so on. Will succeed on the first successful match, and fails if none of the arguments match the text. |
| `(+ a b c ...)` | Alias for `(choice a b c ...)` |
| `(sequence a b c)` | Tries to match a, b, c and so on in sequence. If any of these arguments fail to match the text, the whole pattern fails. |
| `(* a b c ...)` | Alias for `(sequence a b c ...)` |
| `(any x)` | Matches 0 or more repetitions of x. |
| `(some x)` | Matches 1 or more repetitions of x. |
| `(at-least n x)` | Matches at least n repetitions of x. |
| `(at-most n x)` | Matches at most n repetitions of x. |
| `(if cond patt)` | Tries to match patt only if cond matches as well. cond will not produce any captures. |
| `(if-not cond patt)` | Tries to match only if cond does not match. cond will not produce any captures. |
| `(not patt)` | Matches only if patt does not match. Will not produce captures or advance any characters. |
| `(! patt)` | Alias for `(not patt)` |
| `(look offset patt)` | Matches only if patt matches at a fixed offset. offset can be any integer. patt will not produce captures and the peg will not advance any characters. |
| `(> offset patt)` | Alias for `(look offset patt)` |
| `(capture patt ?tag)` | Captures all of the text in patt if patt matches, If patt contains any captures, then those captures will be pushed to the capture stack before the total text. |
| `(<- patt ?tag)` | Alias for `(capture patt ?tag)` |
| `(group patt ?tag) ` | Captures an array of all of the captures in patt.
| `(replace patt subst ?tag)` | Replaces the captures produced by patt by applying subst to them. If subst is a table or struct, will push `(get subst last-capture)` to the capture stack after removing the old captures. If a subst is a function, will call subst with the captures of patt as arguments and push the result to the capture stack. Otherwise, will push subst literally to the capture stack. |
| `(/ patt subst ?tag)` | Alias for `(replace patt subst ?tag)` |
| `(constant k ?tag)` | Captures a constant value and advances no characters. |
| `(argument n ?tag)` | Captures the nth extra argument to the match function and does not advance. |
| `(position ?tag)` | Captures the current index into the text and advances no input. |
| `($ ?tag)` | Alias for `(position ?tag)`. |
| `(accumulate patt ?tag)` | Capture a string that is the concatenation of all captures in patt. This will try to be efficient and not create intermediate strings if possible. |
| `(% patt ?tag)` | Alias for `(accumulate patt ?tag)`
| `(cmt patt fun ?tag)` | Invokes fun with all of the captures of patt as arguments (if patt matches). If the result is truthy, then captures the result. The whole expression fails if fun returns false or nil. |
| `(backref tag ?tag)` | Duplicates the last capture with the tag `tag`. If no such capture exists then the match fails. |
| `(error patt)` | Throws a Janet error if patt matches. The error thrown will be the last capture of patt, or a generic error if patt produces no captures. |
| `(drop patt)` | Ignores (drops) all captures from patt. |