Pattern notation
You can execute an infinite search of siteswaps with a regular expression style like [531]*. In addition to alphanumeric characters, you can use repetitions and wildcards. Only vanilla siteswaps that do not include multiplex or synchronous are searched.
Repetition
* | 0 or more times |
---|---|
+ | 1 or more times |
? | 0 times or 1 time |
{n} | just n times |
{n,} | n or more times |
{n,m} | from n times to m times |
Both n and m are integers greater than or equal to 0. Do not put a space between symbols (it will cause an error).
The repetition operates on the element immediately preceding it. For example, if you specify 51+, it will operate on the 1 before the + and generate strings in the order 51, 511, 5111, 51111, ...
Wildcard and character class
# | 1 character number, same as [0-9] |
---|---|
$ | 1 character alphabet, same as [a-z] |
. | 1 alphanumeric character, same as [0-9a-z] |
[531] | any one character of 5, 3, 1 |
[a-e] | any one character from a to e |
[^x] | other than x, same as [0-9a-wy-z] |
The character class enclosed in [ ] is treated as one element as a whole. For example, if you specify [51]+, that means "5 or 1 repeated one or more times", so it will generate the strings 5, 1, 55, 51, 15, 11, 555, ...
Even if the same characters are specified in [ ], they will be combined into one. [abaa-b] is the same as [ab]. It is case-insensitive and it will be searched for as all lowercase. Special characters such as wildcards cannot be used within [ ].
Selection and grouping
a|b | the string a or b |
---|---|
(ab) | the string ab |
The group enclosed in ( ) is treated as one element as a whole. For example, if you specify (51)+, it will generate strings in the order 51, 5151, 515151, 51515151, ...
You can treat "ab or ba" into one element by combining selection and grouping like (ab|ba).
The group can contain other elements, so you can nest infinite searches. For example, (53*1)+ will generate 51, 531, 5151, 53151, 51531, 5331, 515151, ...
Other characters
Uppercase letters are converted to lowercase. Even if you specify ABC, the output is abc.
If you want to use the special character as it is, put \ before it and escape it. If you want to use the \ itself, put a \ in front of it and say \\.
For example, even if you enter #.## to want to represent a number with 1 digit in the integer part and 2 digits in the decimal part, the result will be 4 characters, that is 1 digit + 1 alphanumeric character + 2 digits. In this case, enter #\.##.
Non-alphanumeric characters are not used in siteswap decisions or ball count calculations. Even if 5.31 or <5,3,1> or 5/3=1 were generated, they would all be calculated as 531.
Language specifications
For reference, I describe the specifications of the accepted pattern in HABA format.
Selection ::= Sequence ('|' Sequence)* ; Sequence ::= Factor+ ; Factor ::= (Letter | Class | Group) Iteration? ; Letter ::= Digit | NonDigit ; Digit ::= "[0-9]" ; NonDigit ::= "\\?." ; Class ::= '#' | '$' | '.' | '[' '^'? (Letter ('-' Letter)?)+ ']' ; Group ::= '(' Selection ')' ; Iteration ::= '*' | '+' | '?' | '{' Integer (',' Integer?)? '}' ; Integer ::= Digit+ ;