gilles_arcas@hotmail.com [sed-users]
2014-08-14 19:12:10 UTC
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]
in all cases?
[Non-text portions of this message have been removed]