Skip to content

feat(router): match regex routes with nitely regex - #336

Open
eveeifyeve wants to merge 2 commits into
dom96:masterfrom
eveeifyeve:nitely-regex
Open

eveeifyeve wants to merge 2 commits into
dom96:masterfrom
eveeifyeve:nitely-regex

Conversation

@eveeifyeve

Copy link
Copy Markdown

std/re binds PCRE1 (EOL) through std/pcre. Regex route patterns now
use nitely regex (pure Nim): the router accepts re2"..." literals
and findRe() fills the capture array, keeping the std/re find()
contract (start index or -1, matches[i] = group i+1).

std/re binds PCRE1 (EOL) through std/pcre. Regex route patterns now
use nitely regex (pure Nim): the router accepts re2"..." literals
and findRe() fills the capture array, keeping the std/re find()
contract (start index or -1, matches[i] = group i+1).
The router imports nitely regex since moving off std/re; the
nimble file must say so. Regex2 (the API the router uses) ships
in regex >= 0.21.0.
Comment thread jester.nim
expectKind(pattern[0], nnkIdent)
case ($pattern[0]).normalize
of "re": return MRegex
of "re2": return MRegex

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about why you're changing this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std/re in nim is deprecated due to using pcre1 and it's recommended to use nitely regex which uses re2. See nim-lang/Nim@8b44b9d for more info.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eveeifyeve
eveeifyeve requested a review from dom96 October 26, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants