Page MenuHomeFreeBSD

regex(3): Add test to cover recent BRE regression
ClosedPublic

Authored by kevans on Jul 13 2017, 4:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 14 2024, 2:23 PM
Unknown Object (File)
Nov 12 2024, 2:54 PM
Unknown Object (File)
Nov 10 2024, 3:28 PM
Unknown Object (File)
Oct 19 2024, 6:42 AM
Unknown Object (File)
Oct 16 2024, 2:24 PM
Unknown Object (File)
Oct 8 2024, 5:54 AM
Unknown Object (File)
Oct 3 2024, 9:54 PM
Unknown Object (File)
Oct 2 2024, 6:06 AM
Subscribers

Details

Summary

BREs recently became prematurely sensitive to the branching
operator, which outright broke expressions that used it instead of
failing silently. Test that \| is matching a literal | for the time
being.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Are \(\) not matching literal parentheses? I guess I'm confused why the 4th column is b|c (and why the first is b). (Also, I'm unfamiliar with this input format and just guessing at what things mean.)

In D11577#240230, @cem wrote:

Are \(\) not matching literal parentheses? I guess I'm confused why the 4th column is b|c (and why the first is b). (Also, I'm unfamiliar with this input format and just guessing at what things mean.)

Correct- In BRE's, \( and \) specify a matching group as () do in EREs.

The first column 'b' means "try this as a BRE only", the second column is the string to try matching it against, the third is the section of the string that the expression matches (all of it, in this case), and the fourth is a comma-separated list of what the subexpressions (matching groups) should match

cem accepted this revision.EditedJul 14 2017, 6:55 PM

Got it! Makes sense. (And consider it approved for commit, if Ed's still out.)

This revision is now accepted and ready to land.Jul 14 2017, 6:55 PM
This revision was automatically updated to reflect the committed changes.