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

Numbers and named groups #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

andrii1812
Copy link

Added method for \d+ pattern for matching numbers
Added function group to avoid writing everywhere '(' + value + ')' and handling named groups

@jehna
Copy link
Contributor

jehna commented Jan 3, 2016

@andrii1812 thank you for this PR.

Since these are new features, I'd like to raise a bit of discussion at the implementation repo:
VerbalExpressions/implementation#6
VerbalExpressions/implementation#7

Other than that, I suppose the name argument should be present in all of the grouped methods. Now it's missing from:

  • anything_but
  • maybe
  • find
  • any
  • line_break
  • range

@andrii1812
Copy link
Author

There is a problem with re_escape decorator. If we pass name without keyword name= it will be passed into *args parameter. For example in:
VerEx().start_of_line().find('123', 'my_number').end_of_line().regex()
'my_number' will be escaped to 'my\\_number'
and error will occur:
error: bad character in group name 'my\\_number'
For what reason reason re_escape takes *args argument? It only used with only one argument, except range where escaping is not so nessesary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants