Issue #26: optimize for regexes that end in .* or .+