aboutsummaryrefslogtreecommitdiff
path: root/text-regex.c
AgeCommit message (Collapse)AuthorFilesLines
2020-04-27Avoid use of VLAsMichael Forney1-2/+2
2020-01-23text: fix spurious regex anchor matchesMarc André Tanner1-0/+4
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é Tanner1-1/+0
2017-01-13text-regex: add text_regex_nsub to get number of sub expressionsMarc André Tanner1-0/+6
2016-08-07text-regex: improve searching in binary dataMarc André Tanner1-20/+43
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é Tanner1-0/+4
2016-03-14text-regex: fix possible infinite loop when searching backwardsMarc André Tanner1-1/+11
2016-01-18text-regex: remove unused struct memberMarc André Tanner1-2/+0
2016-01-10Simplify code by using text_bytes_alloc0Marc André Tanner1-6/+2
2015-07-19text: move regex related functions to separate fileMarc André Tanner1-0/+71
Eventually this should probably be rewritten to use an iternal regex engine, currently it has unacceptable memory usage, it copies the whole text.