The regexp simplifies the conditional. Both are rather unreadable, so go with whatever makes sense.