Target: for ($i = 0; $i < count($columns); $i++)
Search: \(((\$\w) = \d); \$\w\s<\s(count\(\$(\w+)\)); (\$\w\+\+)\)
Replace: ($1, $2n = $3; $2 < $2n; $5)
function findStringBetween($start, $end, $string)
{
preg_match_all('/' . preg_quote($start, '/') . '([^\.)]+)'. preg_quote($end, '/').'/i', $string, $m);
return $m[1];
}
$start = "{product_attribute_loop_start}";
$end = "{product_attribute_loop_end}";
$matches = $this->findStringBetween($start, $end, $template);
\{product_loop_start\}(.*)\{product_loop_end\}
\{product_loop_start\}(((?!\{product_loop_start\}\{product_loop_end\}).)+)\{product_loop_end\}
In PHPStorm or Sublime Text2 or 3 search box you add:
require_once(\s)*\((.*)\);
And replace it for:
require_once $2;
Target: foo['xyz']
Search : foo(\[\'(.*)\'\])
Replace : foo->$2
Target: $this->assignRef('foo', $foo)
Search: \$this->assignRef\('(.*)', (.*)\)
Replace: $this->$1 = $2
Target: $array ['foo']
Search: (\$.*) (\[(.*)\])
Replace: $1$2
Target: new EasyBlogModelBlogs();
Output: new EasyBlogModelBlogs;
Search: (new (?!Array|Object|Option|XMLHttpRequest)[a-zA-Z_]*)\(\);
Replace: $1