<- Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/main/regexstate.go
Commit message (Collapse)AuthorAgeFilesLines
* Remove the redundant regex implementationCharlie Stanton2022-12-241-48/+0
|
* Initial commitCharlie Stanton2022-09-211-0/+48
Parses and executes substitute expressions (subexes) So far subex has the following operations: - Concatenation of a and b with ab - Or with | - Repeat maximally with * - Repeat minimally with - - Copy a specific character 'a' - Copy any character '.' - Store text matching a regex into slot 's': `$s(regex)` - Output text in "" including loading from slots with '$' Regexes support all the same operations as subexes minus storing and outputting This first implementation gives very little thought to efficiency Example: ./main 'according to all known laws of aviation' '$1(.-)$m(( .* )| ).*"$m$1"' This swaps the first and last words of the input string