Regular Expressions/operator/hook

From Wikibooks, open books for an open world
< Regular Expressions
Jump to: navigation, search

The hook operator is used to match 0 or 1 of the preceding expression. For example, "ab?c" matches "abc" or "ac" not "abbc". Also (ab)?c matches "abc" or "c".