summaryrefslogtreecommitdiff
path: root/text-regex.c
AgeCommit message (Collapse)Author
2020-04-27Avoid use of VLAsMichael Forney
2020-01-23text: fix spurious regex anchor matchesMarc André Tanner
The regex anchors ^ and $ must not match at the start/end of the search range unless it is preceded/succeeded by a new line. This is implemented at the text-motion layer by passing the appropriate REG_NOT{B,E}OL flags to the search backend, meaning the caller can influence the anchor behavior depending on the context. This is important as for example in the command language the anchors apply to existing selections, not line boundaries.
2017-01-16vis: cleanup regex header inclusionMarc André Tanner
2017-01-13text-regex: add text_regex_nsub to get number of sub expressionsMarc André Tanner
2016-08-07text-regex: improve searching in binary dataMarc André Tanner
The regex(3) API we currently use, matches on NUL terminated strings. Therefore it does not work for binary data. This commit adds loops to manually skip over NUL bytes. While it does not work for patterns which would match strings containing NUL bytes, it should improve the most basic cases. Binary file handling will need further improvements in the future. Fixes #359.
2016-04-03text-regex: introduce function to match arbitrary textMarc André Tanner
2016-03-14text-regex: fix possible infinite loop when searching backwardsMarc André Tanner
2016-01-18text-regex: remove unused struct memberMarc André Tanner
2016-01-10Simplify code by using text_bytes_alloc0Marc André Tanner
2015-07-19text: move regex related functions to separate fileMarc André Tanner
Eventually this should probably be rewritten to use an iternal regex engine, currently it has unacceptable memory usage, it copies the whole text.