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

Please remove ONIG_MAX_CAPTURE_NUM and ONIGERR_TOO_MANY_CAPTURES #46

Closed
yurivict opened this issue Jan 1, 2017 · 7 comments
Closed

Comments

@yurivict
Copy link

yurivict commented Jan 1, 2017

There is no need to assume that regular expressions are small and to limit something with the arbitrary number 32767.

@kkos
Copy link
Owner

kkos commented Jan 2, 2017

The capture numbers are expressed in a bytecode as short int.

@yurivict
Copy link
Author

yurivict commented Jan 2, 2017

Can this be expanded to 64 bit and this limit made consistent with the limit typedef?

@yurivict
Copy link
Author

yurivict commented Jan 2, 2017

Is it typedef short int MemNumType;?

@k-takata
Copy link
Contributor

k-takata commented Jan 2, 2017

I'm really curious about your usage.
What do you want to use such many capturing groups for?
Isn't it enough using non-capturing groups (?:foobar)?

@yurivict
Copy link
Author

yurivict commented Jan 2, 2017

I use rather large regular expressions to find certain terms in texts. There are a lot of terms, lists can be arbitrarily large.

It works fine, except it hits this limit.

So I suggest you increase the limit, so that nobody has to hit it again. 16-bit vs. 32-bit field doesn't really save much performance-wise. Also please make the limit consistent with the data type.

@kkos
Copy link
Owner

kkos commented Jan 3, 2017

I have updated develop branch.
NEW API: onig_set_capture_num_limit()
This is experimental and may put it back when my feeling changes.

Default capture number limit (32767) is not changed.
Call onig_set_capture_num_limit(0) to be unlimited.

@yurivict
Copy link
Author

yurivict commented Jan 3, 2017

Thanks!

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

No branches or pull requests

3 participants