19 lines
375 B
PHP
19 lines
375 B
PHP
|
#!/usr/bin/php
|
||
|
<?php
|
||
|
|
||
|
function y($m) { $m = preg_replace("/\./", " x ", $m);
|
||
|
$m = preg_replace("/@/", " y", $m);
|
||
|
return $m;
|
||
|
}
|
||
|
|
||
|
function x($y, $z) { $a = file_get_contents($y);
|
||
|
$a = preg_replace("/(\[x (.*)\])/e", "y(\"\\2\")", $a);
|
||
|
$a = preg_replace("/\[/", "(", $a);
|
||
|
$a = preg_replace("/\]/", ")", $a);
|
||
|
return $a;
|
||
|
}
|
||
|
$r = x($argv[1], $argv[2]);
|
||
|
print $r;
|
||
|
|
||
|
?>
|