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

Matching on streams #83

Open
cpitclaudel opened this issue Dec 14, 2016 · 2 comments
Open

Matching on streams #83

cpitclaudel opened this issue Dec 14, 2016 · 2 comments

Comments

@cpitclaudel
Copy link

Hi there,

Thanks for the cool work on Onigmo!

How hard would it be to extend this library to support matching on arbitrary streams, instead of strings? I'm looking for an equivalent of TRE's tre_reguexec.

The basic idea is that the caller can pass the equivalent of an iterator over something that may not be a string. This would make it possible to match over gap buffers, ropes, piece tables, and other string implementations that do not rely on a contiguous char array.

Thanks!

@k-takata
Copy link
Owner

I think this is useful, but unfortunately I don't think it's easy to implement in Onigmo.

@cpitclaudel
Copy link
Author

Do you think it would be easier to add a limited form of this which supports passing the subject string as an array of strings? Onigmo would consider that as just one string, ignoring the fact that it's split up. This should provide reasonable efficiently, while being a bit simpler to implement, maybe?

Even simpler, how hard would it be to support just two such strings? This would allow Onigmo to work for gap buffers.

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

2 participants