Regular Expressions/operator/hook

From Wikibooks, open books for an open world
Jump to navigation Jump to 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".