Jump to content

Regular Expressions/operator/hook

From Wikibooks, open books for an open world

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".