You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The '?', '+', and '|' characters; it is implementation-defined whether "?", "+", and "|" each match the literal character '?', '+', or '|', respectively, or behave as described for the ERE special characters '?', '+', and '|', respectively (see 9.4.3 ERE Special Characters).
Note:
A future version of this standard may require "\?", "\+", and "\|" to behave as described for the ERE special characters '?', '+', and '|', respectively.
GNU and BSD sed’s treat \?, \+, and \| in BRE as the ERE counterparts, whereas uutils does not:
$ cargo run --quiet -- -n -e '/cats\?$/p'<<<$'cat\ncats?'cats?
$ sed -n -e '/cats\?$/p'<<<$'cat\ncats?'cat
$ cargo run --quiet -- -n -e '/se\+d/p'<<<$'seed\nse+d'se+d
$ sed -n -e '/se\+d/p'<<<$'seed\nse+d'seed
$ cargo run --quiet -- -n -e '/foo\|bar/p'<<<$'foo\nfoo|bar'foo|bar
$ sed -n -e '/foo\|bar/p'<<<$'foo\nfoo|bar'foofoo|bar
POSIX does not mandate the behavior, but it would be preferable.
When a BRE matching a single character, a subexpression, or a back-reference is followed by an interval expression of the format "\{m\}", "\{m,\}", or "\{m,n\}", together with that interval expression it shall match what repeated consecutive occurrences of the BRE would match. The values of m and n are decimal integers in the range 0<=m<=n<={RE_DUP_MAX}, where m specifies the exact or minimum number of occurrences and n specifies the maximum number of occurrences. The expression "\{m\}" shall match exactly m occurrences of the preceding BRE, "\{m,\}" shall match at least m occurrences, and "\{m,n\}" shall match any number of occurrences between m and n, inclusive.
The brace quantifiers are mandatory but currently uutils does not support them.
Activity
e-kwsm commentedon Feb 5, 2026
The brace quantifiers are mandatory but currently uutils does not support them.
[-]`\?`, `\+`, and `\|` in BRE[/-][+]`\?`, `\+`, `\|`, `\{m\}`, `\{m,\}` and `\{m,n\}` in BRE[/+]LoukasPap commentedon Feb 16, 2026
I'll check that out too.
LoukasPap commentedon Apr 2, 2026
Waiting to work on top of #328 when it gets merged.
e-kwsm commentedon May 1, 2026
Thank you, but BRE brace quantifiers are not supported yet (60243b4).