mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
287 B
12 lines
287 B
15 years ago
|
sys = require('sys');
|
||
|
|
||
|
var regexIn = process.argv[2];
|
||
|
var replacement = process.argv[3];
|
||
|
var re = new RegExp(regexIn, 'g');
|
||
|
var stdin = process.openStdin();
|
||
|
|
||
|
stdin.addListener("data", function (data) {
|
||
|
data = data.toString();
|
||
|
process.stdout.write(data.replace(re, replacement));
|
||
|
});
|