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)
Sat, Mar 30, 1:38 PM
Unknown Object (File)
Mar 16 2024, 5:34 PM
Unknown Object (File)
Jan 16 2024, 7:13 PM
Unknown Object (File)
Jan 9 2024, 9:41 PM
Unknown Object (File)
Dec 18 2023, 12:10 PM
Unknown Object (File)
Dec 17 2023, 4:44 AM
Unknown Object (File)
Nov 18 2023, 11:41 PM
Unknown Object (File)
Nov 18 2023, 9:31 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.