Regular expression which matches a pattern, or is an empty string
To match pattern or an empty string, use ^$|pattern Explanation ^ and $ are the beginning and end of the string anchors respectively. | is used to denote alternates, e.g. this|that. References regular-expressions.info/Anchors and Alternation On \b \b in most flavor is a “word boundary” anchor. It is a zero-width match, i.e. an empty string, … Read more