One command isn't always best. It's elegant, I give you that, but it also causes a regular expression evaluator to be created, which causes overhead. If this function was only going to be used once per JVM the REGEX overhead would be overkill, but if the application called the function 10000s...