Question

Once again, I am stuck with some regex and I don't really know where to start.

I am using vQmod to build an OpenCart extension and I want to be able to search all files that have this code:

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template')

The problem is, the code above has more code in that line in each file. Is there a regex function that lets me search for part of a line of code with vQmod?

here is what I have tried so far:

<search position="before" regex="true"><![CDATA[~if \(file_exists\(DIR_TEMPLATE . $this->config->get\('config_template'\)~]]></search>

Thanks, Peter

Was it helpful?

Solution

To search every catalog controller file (which is where all of these are) you would use

<file name="catalog/controller/*/*.php">

If you want to do a search for a regex, you use regex="true" and then place your regex in the CDATA tags

<search position="before|after|replace" regex="true"><![CDATA[~regex-here-including-delimiters~]]></search>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top