Altered regexp to match the existing functionality as closely as possible