Saturday, January 24, 2009

Saving time Tips1: Emeditor & Regexp

Original text:

a1,
p1,
t1,
a2,
p2,
t2,
price,
p3,
period,
bt,


Objective text:

$a1 = $_POST[”a1″];
$p1 = $_POST[”p1″];
$t1 = $_POST[”t1″];
$a2 = $_POST[”a2″];
$p2 = $_POST[”p2″];
$t2 = $_POST[”t2″];
$price = $_POST[”price”];
$p3 = $_POST[”p3″];
$period = $_POST[”period”];
$bt = $_POST[”bt”];


Tool: Emeditor

Using regexp replace:

Find:

(.*),

Replace with:

$\1 = $_POST[”\1″];

-------------------------------------

Emeditor also has Macro function, what the fucking it easy to being.

No comments:

Post a Comment