Posted By

rwczippy on 05/27/10


Tagged

regex php textmate search replace


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

cyril
benrudolph
Tyster


RegEx to find replace in TextMate


 / Published in: Regular Expression
 

URL: http://screenflicker.com/mike/code/textmate-regex-replace/

search for anything in-between two 's and then replace the found string into the PHP if/else staement. $1 is wher TextMate stores the found string. (see http://screenflicker.com/mike/code/textmate-regex-replace/)

  1. Search Term:
  2. <TAG>(.*)</TAG>
  3.  
  4. Replace Term:
  5. \$$1 = \$_POST['$1'];
  6. if (\$$1) echo "<tr><td>$1</td><td>\$$1</td></tr>";
  7. else echo "";

Report this snippet  

You need to login to post a comment.