Validate pattern using the new API