regextextmateoniguruma

Textmate Regex Simple Find/Replace


I am trying to do a simple find and replace. I have:

  <?php $url = 'http://www.mywebsite.net/this-is-a-page.php'; ?>

as a variable on each page and I'm replacing it with:

  <?php $url = curPageURL(); ?>

I had my find set up like this:

   <?php $url =( .*); ?>

but that's clearly incorrect because it doesn't return any results when I hit find. Any help would be super appreciated.

Thanks!


Solution

  • You need to escape some characters.

    Try this <\?php \$url =( .*); \?>

    Escaping them changes them to literal matches.