Enhances the regex
This commit is making the regex more strinct so it takes into consideration only a  variable instead of anything which is trailed by wp_query