Shorter syntax using matchesPattern()