I want to alter thousands of lines in a project, the line is always one of these formats and is always in the middle of a line.
link() accepts upto 3 parameters and can look like these:
$this->url->link('this/path')
$this->url->link('this/path', '', true)
$this->url->link('this/path', 'something=' . $something, true)
$this->url->link('this/path', 'something=' . $something . '&other=' . $other, true)
I have a put together the following regex which correctly finds the lines I want as set out above with no problem.
// regex
\$this->url->link.*(, true)
I want to be able to remove empty parameters from the line so basically this means:
If parameters two and three match '', true remove them, otherwise remove just paramter three: , true
I tried these:
\$this->url->link.*(.*)
\$this->url->link.*($1)