Equivalence Classes Of Repetition MetaChars
There are two types of Repetition MetaChars. The simple ones are *
, +
, and ?
. The general ones are ranges specified inside {
and }
. Here are equivalence classes between these two sets.
These use the -E (extended regex) option for OSX's sed
.
*
is equivalent to{0,}
Zero or more of the preceeding character.
+
is equivalent to{1,}
One or more of the preceeding character.
?
is equivalent to{0,1}
Exactly zero or one of the preceeding character.
Last updated