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

Regular expressions should support non-capturing groups #3969

Closed
vicuna opened this issue Feb 2, 2006 · 3 comments
Closed

Regular expressions should support non-capturing groups #3969

vicuna opened this issue Feb 2, 2006 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Feb 2, 2006

Original bug ID: 3969
Reporter: rillig
Status: acknowledged (set by @damiendoligez on 2006-03-29T14:27:01Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.09.0
Category: otherlibs
Tags: patch

Bug description

In Perl, one can write qr"start(?:alt1|alt2|alt3)(.*)end" to compile a regular expression that has only one capturing group, namely the second one. The first "group" is just an alternative. I have written a patch to support this feature in O'Caml too, since I don't know of another way to write the regexp above that is similarly short and readable.

Additional information

Unfortunately, this patch might change the behavior of some regular expressions that look like foo(?, because a question mark that appears at the start of a regular expression is taken literally.

File attachments

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 18, 2020
@mshinwell
Copy link
Contributor

@xavierleroy Could you please advise what should be done for feature requests on the Str library like this one?

@xavierleroy
Copy link
Contributor

I would say that that the Str library is in maintenance mode: bugs will be fixed, but it's probably not getting new features. This, plus the fact that the proposed feature is not completely backward-compatible, suggest that we should close this PR.

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

No branches or pull requests

3 participants