#programming/raku #programming/regex
Regex- a pattern for strings /^ start $/ end
| Character Class | Negation | Matches |
|---|---|---|
| \d | \D | A digit |
| \w | \W | A word character (letter, digit, underscore) |
| \s | \S | Whitespace, blanks, newlines, etc. |
| \h | \H | Horizontal whitespace |
| \v | \V | Vertical whitespace |
| \n | \N | Logical newline (carriage return, line feed) |
| . | Any char |
| Method | Example | Matches |
|---|---|---|
| Enumeration | [abc] | a, b, or c |
| Negation | -[abc] | Anything except a, b, or c |
| Range | [a..c] | a, b, or c |
* 0..Inf
+ 1..Inf
? 0..1
** 3 3
** 1..5 1..5