Rewrote RewriteCond test string expansion to reflect actual C implementation