nim-regex icon indicating copy to clipboard operation
nim-regex copied to clipboard

Pure Nim regex engine. Guarantees linear time matching

Results 24 nim-regex issues
Sort by recently updated
recently updated
newest added

The following code compiles, but the group just contains the last capture: ```nim var m: RegexMatch doAssert "abab".match(re"(?Pab)(?Pab)", m) doAssert m.group("foo") == @[2 .. 3] doAssert m.group(0) == @[0 .....

I would like to be able to perform an uppercase transform on a regex replacement. For example: ```nim check("STUFFabc".replace(re"STUFF([a-z])([a-z]+)", "\u$1$2") == "Abc") ``` Basically, I want something like described [here](https://www.regular-expressions.info/replacecase.html)

Useful when you have when you want to save/forward regex between procs or serialize.

- [ ] detect errors at CT instead of RT if both regex pattern and replace pattern are given at CT eg: `echo "abcfoodef".replace(re"f(o)o", "[$2]")` should give a CT error...

```nim import pkg/regex when defined(case2): # BUG: abc$2def instead of error as in case3b (should use "$$2" if that's what user wants) echo "abcfoodef".replace(re"foo", "$2") when defined(case3b): # OK: RT...

``` nim let re_han = re(r"(*U)([\p{Han}]+)") ``` I tried `re` and `nre` module, this works but very slow,and `re` is much slower than `nre`, so I'm looking for this module,...

There are times when one has a large (or possibly unlimited) amount of input. It would be nice to have match procedures that would accept a `moreDataProc` or similar parameter,...

The documentation suggests that currently flags are passed as characters in a string. In my opinion, it's much cleaner and easier to read to pass a `set[Flag]` where `Flag` is...

Doing `text[group(m, x)]` for both empty-match/non-match returns an empty string. The current way to check if `group(m, x)` matched is to do `group(m, x) != reNonCapture`. I think it would...

design

[link](https://github.com/thechampagne/libnregex) 👍