views:

17

answers:

1
RewriteRule ^/?page/?([a-zA-Z0-9,-]+)$ $1.php [L]

is it possible for a text editor to find and replace a string in a manner as how apache's mod_rewrite does it? i mean for example, in a text-file, i'd like to enclose all email addresses inside double qoutes,

by inputting [a-zA-Z_]@[a-zA-Z-]+\.[a-zA-Z.]+ in the "find what" field
and "$1" in the "replace with" field, i get all email addresses replaced with literally a $1, but i wanted the original value just to be appended and preceeded by double qoutes?

or are there any easier approach over the problem ???

+1  A: 

Different text editors handle the replacement value in different ways. Some use the $1 as you have shown, others use \1. There is also at times special tokens for 'the entire match.' TextPad, for example, will use & to indicate the entire matched input. It might be best to consult the regex help supplied (I hope) with your editor.

akf