Skip to content

Rename nonbacktracking subexpression to atomic group#16980

Merged
Thraka merged 4 commits intodotnet:masterfrom
danmoseley:atomic
Feb 10, 2020
Merged

Rename nonbacktracking subexpression to atomic group#16980
Thraka merged 4 commits intodotnet:masterfrom
danmoseley:atomic

Conversation

@danmoseley
Copy link
Member

We currently call the (?>...) construction a "Nonbacktracking (or "greedy") subexpression."

As pointed out by @stephentoub , it is a use of greedy that is not standard. The standard term seems to be atomic group, with some variation eg atomic subexpression, once-only subpattern (PHP) etc.

Changed to atomic group throughout with acknowledgement in one location of the alternative terms.

BTW it feels like subexpression and nonbacktracking ought to have hyphens, but I'm not changing that here.

@stephentoub

@danmoseley
Copy link
Member Author

PHP - once only subpattern: https://www.php.net/manual/en/regexp.reference.onlyonce.php
Regexegg: atomic group https://www.rexegg.com/regex-disambiguation.html
Regularexpressions-info: atomic group https://www.regular-expressions.info/atomic.html
Boost : independent sub-expressions https://www.boost.org/doc/libs/1_44_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html
RE2: possessive match (but given its nature doesn't need them) https://github.com/google/re2/wiki/Syntax
Ruby: atomic group: https://ruby-doc.org/core-2.7.0/Regexp.html
PCRE: atomic group http://www.pcre.org/pcre2.txt

@stephentoub
Copy link
Member

stephentoub commented Feb 5, 2020

cc: @CyrusNajmabadi

@CyrusNajmabadi
Copy link
Contributor

thnks! i can make the roslyn change when this goes in.

@stephentoub
Copy link
Member

Thanks for updating this, @danmosemsft.

@danmoseley
Copy link
Member Author

Feedback addressed

@danmoseley
Copy link
Member Author

@Thraka does this look good to merge?

Copy link
Contributor

@Thraka Thraka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Successfully merging this pull request may close these issues.

5 participants