Regex (short for regular expressions) is a powerful tool used to define patterns for matching and manipulating text. Two of the modes in the wordle assistant tool use regexes to filter the words in the dictionary.
On their own, literal characters match exactly what you type.
table → Matches "table" exactly.appl → Matches "apple" and "apply".tab → Matches all of "table", "taboo", and "stabs", but does not match "trabs", "blast", or "baton".Note that the order of characters within the regex matters, but that the pattern can be matched anywhere in the word. (eg: table vs stabs)
. → Matches any single character.a.p.e matches "apple" and "ample", but not "ape" or "agree".
* → Matches zero or more of the preceding character.a* matches "", "a", "aa", "aaa", etc.
+ → Matches one or more of the preceding character.e+ matches "e", "ee", "eee" but not "".
? → Matches zero or one of the preceding character.i? matches "" and "i", but nothing else.
o{5} → Matches precisely 5 "o"s ("ooooo").
u{2,4} → Matches between 2 and 4 "u"s ("uu", "uuu", "uuuu").
^ → Matches the start of the word.^t matches "table" but not "plate".
$ → Matches the end of the word.e$ matches "table" but not "abled".
[aeiou] → Matches any one vowel.t[aeiou]ble matches "table" but not "trble".
[^aeiou] → Matches any one non-vowel character.b[^aeiou]t matches "brt" but not "bat". ("byte" is the only valid word which would be found by that regex)
[a-f] → Matches any one character between a and f ("a", "b", "c", "d", "e", or "f").^[a-f]*$ matches "decaf" and "faded", but not "cedar".match a word composed entirely of only the characters betweeen a and f.[g-z] instead.remove all words that have any character between g and z (ie: other than a to f).| allows you to specify different alternatives.
batch|hasty → Matches both "batch" and "hasty", and nothing else.^(cat|dog) → Matches "catch" and "dogma", as well as a few others.(cr|sh)ape → Matches both "crape" and "shape", and nothing else.^(a|e|i|o|u) is equivalent to ^[aeiou]. Note that the parentheses are required to indicate that the start-of-line anchor is not part of the first alternative.
This is also what lends | its power: it's possible to specify more complicated patterns than with [] since the latter option is limited to only one character.
Taking the final example from above, if we try to construct the equivalent regex with [] instead, we get the following:
[cs][rh]ape → Matches both "crape" and "shape", but also "chape".c.t → Matches words where "c" and "t" are separated by one letter (eg: "facet", "acute").[^aeiou]{5} → Matches words with only consonants (eg: "crypt", "psych", "hymns").[gray letters here] → On remove matches mode, this will filter out all words that contain any of the letters specified.^ and $ together to match entire words exactly.