Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support grouping #8

Closed
hedhyw opened this issue Jun 14, 2022 · 0 comments · Fixed by #32
Closed

Support grouping #8

hedhyw opened this issue Jun 14, 2022 · 0 comments · Fixed by #32
Assignees
Labels
enhancement New feature or request

Comments

@hedhyw
Copy link
Owner

hedhyw commented Jun 14, 2022

Definition

(re)           numbered capturing group (submatch)
(?P<name>re)   named & numbered capturing group (submatch)
(?:re)         non-capturing group

Example methods

rex.Group.Define(...dialect.Token) GroupToken // `(tokens)`
rex.Group.Composite(...Token) GroupToken // `(a|b|c)`
type GroupToken struct {
   prefix   string
   tokens ...dialect.Token
}

WithName(name string) dialect.Token // prefix -> `?P<name>`
NonCaptured() dialect.Token  // prefix -> `?:`
@hedhyw hedhyw added the enhancement New feature or request label Jun 14, 2022
@hedhyw hedhyw self-assigned this Jun 14, 2022
@hedhyw hedhyw mentioned this issue Jun 15, 2022
@hedhyw hedhyw assigned thaithimyduyen and unassigned hedhyw Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants