Skip to content

Your regex package is referenced in the Nim book now #112

@StefanSalewski

Description

@StefanSalewski

For the regex section we have decided to base the introducing explanations on your regex module instead of the re and nre modules of Nim's standard library.

Please let us know if you consider some of the explanations wrong or unclear. Please note that that section has not yet been checked by one of our proof readers, so it may contain grammar or spelling errors.

Maybe you can comment on

For a successful match we can access the capture with the group() function(, where we have to specify the index number of the capture, and the actual text string that was used for the match. The fact that we have to specify the initial text may look a bit strange indeed.

Is there a good reason that group() gets passed the whole string again as last parameter? Seems to be inconvenient and error prone, can a reference to that string not be saved in the RegexMatch instance when it is passed to match() ?
I think some other regex engines do not use that passed string for the captured groups.

Best regards, Stefan Salewski

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions