@powelski OK thanks for explaining. Yes this does seem a lot cleaner than using the pattern.

However, this approach also probably falls into the [clever code](http://make.wordpress.org/core/handbook/coding-standards/php/#clever-code) category. If you're not familiar with it, it takes a moment to understand exactly what it's doing.

So with this in mind, I would probably side with readability over brevity here and use the regex pattern anyway.