aboutsummaryrefslogtreecommitdiff
path: root/text-regex.h
AgeCommit message (Collapse)AuthorFilesLines
2017-01-19text-regex: add regex backend based on libtreMarc André Tanner1-0/+5
While memory consumption should be improved, backward searches will still be slow, because they are implemented in terms of repeated forward searches. It needs to be investigated whether the underlying automaton can have its transitions reversed and essentially run backwards, as is the case in sam.
2017-01-13text-regex: add text_regex_nsub to get number of sub expressionsMarc André Tanner1-0/+1
2017-01-13text-regex: slightly clean up headerMarc André Tanner1-2/+2
We generally omit parameter names in function prototypes when their meaning is clear.
2016-04-03Support sam's structural regular expression based command languageMarc André Tanner1-0/+1
For those not familiar with sam(1) more information can be found at http://sam.cat-v.org/ For now sam commands can be entered from the vis prompt via :sam <cmd> A command behaves differently depending on the mode in which it is issued: - in visual mode it behaves as if an implicit extract x command matching the current selection(s) would be preceding it. That is the command is executed once for each selection. - in normal mode: * if an address for the command was provided it is evaluated starting from the current cursor position(s) i.e. dot is set to the current cursor position. * if no address was supplied to the command then: + if multiple cursors exist, the command is executed once for every cursor with dot set to the current line of the cursor + otherwise if there is only 1 cursor then the command is executed with dot set to the whole file The command syntax was slightly tweaked to accpet more terse commands. - When specifiying text or regular expressions the trailing delimiter can be elided if the meaning is unambigious. - If only an address is provided the print command will be executed. - The print command creates a selection matching its range. - In text entry \t inserts a literal tab character (sam only recognizes \n). Hence the sam command ,x/pattern/ can be abbreviated to x/pattern If a command is successful vis switches to normal mode (and hence removes any selections), otherwise the editor is kept in visual mode. The print command "fails" by definition.
2016-04-03text-regex: introduce function to match arbitrary textMarc André Tanner1-0/+1
2016-01-13Add -pedantic to debug CFLAGS and fix resulting warningsMarc André Tanner1-1/+1
2015-07-19text: move regex related functions to separate fileMarc André Tanner1-0/+15
Eventually this should probably be rewritten to use an iternal regex engine, currently it has unacceptable memory usage, it copies the whole text.