Differences between BRE and ERE in syntactic behavior of quantifiers (gnu sed 4.2.1)

"[email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
Following a previous discussion, I would like to report some BRE/ERE differences for ill-formed regexp including quantifiers.* Quantifier at start of regexp (i.e. following an empty regexp)For instance: echo x | sed -e "/*/p"BRE: this is valid syntax for *, ? and +, but invalid for {}ERE: always invalid* Double quantifierFor instance: echo x | sed -e "/x**/p"BRE: whatever quantifier is in first position, this is valid syntax when ? or + is in second position, invalid when * or {} is in second positionERE: always validIt is confusing to have different behaviors not only between BRE and ERE, but also between quantifiers. This could deserve some clarification.Would there be any drawback to consider these expressions equivalent to /()q/ and /(xq)q'/ for any quantifier q and q', which are valid
  in all cases?


[Non-text portions of this message have been removed]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.