4 ms·
Doesn’t that confuse you because it is the alternation symbol (https://regular-expressions.mobi/alternation.html https://regular-expressions.mobi/alternation.ht
by Someone 8y ago
Doesn’t that confuse you because it is the alternation symbol (https://regular-expressions.mobi/alternation.html https://regular-expressions.mobi/alternation.html) in many, if not all, regular expression syntaxes?
- michaelcampbell 8y agoIt's rare that I need a sedex with both paths and alternation, but if I do I'll use something other than / or |. That's the point of this article; if what you're using is going to hinder obviousness, USE SOMETHING ELSE. Because... you can.
- marcosdumay 8y agoAnd comma appears in repetition limits (like in /a{1,2}/). I don't see much difference.
- bonzini 8y agoRepetition in sed would be written \{1,2\}, it's unwieldy enough that it's rarely used.
- cyphar 8y agoGiven the whole "sed" vs "sed -E" distinction, I'd say most metacharacters are confusing anyway. Not to mention usually when I'm using "|", I'm going to be replacing paths and don't really use alternation that often.