-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
revision: 3504109
From POSIX BRE:
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'
foo
foo|barPOSIX does not mandate the behavior, but it would be preferable.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels