Use bash internal regexp as much as possible