9 Commits

Author SHA1 Message Date
Jefferson González
3c64c32379
core: ported regex.gsub to faster native version (#1233)
* added regex.gmatch iterator and other fixes
* fixed issues reported by Guldoman
* push strings with fixed len just in case for binary safety
* added limit to regex.gsub and use pushinteger
* added description to regex.gsub limits param
* replaced substitutions regex description for correctness
* ignore negative limits on regex.gsub
2022-12-20 17:46:37 -04:00
Guldoman
9d48441685
Add regex.find_offsets, regex.find, improve regex.match (#1232)
`regex.match` now behaves like `string.match`.
This required changes in the `tokenizer` and in the `detectindent` 
plugin.
2022-12-11 22:25:42 -04:00
Guldoman
f7ad8753eb
Improve regex.gsub performance (#1220) 2022-12-02 19:21:05 -05:00
Guldoman
14be51b1ec
Make regex.match return all the results 2022-05-28 01:21:41 +02:00
Guldoman
1872e82141
Make regex.match return the appropriate end index
This makes its behavior similar to `string.find`.
2021-10-11 22:32:50 +02:00
Francesco Abbate
218999dff8 Avoid bug when replacement stop at end of string
Detect when we are past the end of the string to avoid by
checking if byte is not nil.

Fix #510.
2021-09-10 14:55:04 +02:00
Adam Harrison
0777a6f0b8 Merged dev to master. 2021-07-20 14:39:50 -04:00
Adam Harrison
3b816a2b4a Changed regex error handling, so that errors can be handled gracefully in lua, and made it so gsub returns the exact matches and replacements. 2021-06-04 23:58:17 -04:00
Adam
248d70a8ca
Add PCRE to support regular expressions
Use regular expressions instead of Lua patterns for find and replace editor commands.

Syntax files can now use regex or Lua patterns as before keeping backward compatibility for plugins.
2021-06-02 21:27:00 +02:00