nitely / nim-regex

Pure Nim regex engine. Guarantees linear time matching
https://nitely.github.io/nim-regex/
MIT License
227 stars 20 forks source link

regression: match of some pattern now fails; breaks `pkg/glob` #83

Closed timotheecour closed 3 years ago

timotheecour commented 3 years ago

see https://github.com/citycide/glob/issues/49

https://github.com/citycide/glob/issues/49#issuecomment-716218508

The cause of this breakage is that glob does not work with regex 0.17.0. 0.16.2 works as expected.

After this is fixed, https://github.com/citycide/glob/pull/50 should be reverted

timotheecour commented 3 years ago

@nitely I've reduced it to something that doesn't involve pkg/glob:

here's a pkg/glob test that fails:

check "src/dir/foo.nim".matches("src/**/*.nim", false)

(insert debugEcho (result,) in regexer.globToRegexString to show the corresponding regex)

here's the root cause:

when true: # D20201031T180321
  import pkg/regex
  proc main()=
    let pattern = "^src/(?:[^\\/]*(?:\\/|$))*[^/]*\\.nim$"
    echo "src/dir/foo.nim".match(pattern.re)
  main()

nim-regex v0.16.2: true nim-regex master (c6bd63dec82982b23680c4a97a3ee82d04dbda49): false