Replacing three similar regexps with a single one