Extended Regular Expressions (ERE)

Metachar ?

Matches the preceding element zero or one time.

Example:

xy?z matches only "xy" or "xyz".

Metachar +

Matches the preceding element one or more times.

Example:

xy+z matches "xyz", "xyyz", and so on, but not "xz".

Metachar |

Aternation operator, matches either the expression before or the expression after the operator.

Example 1:

(abc)|(xyz) matches "abc" or "xyz"

Example 2:

(data)|(information) matches "data" or "information".

See also the grouping meta char ( ) described above.

Get hands-on with 1200+ tech skills courses.