Etapa 1: (use o modo de pesquisa de expressões regulares)
Localizar: include 'test[\d]{0,}.php'; echo "
Substitua por: \ninclude 'hostsList.php';\n\nforeach\($hosts as $fileName => $bbCode\) {\n\techo $bbCode;\n\tinclude $fileName;\n\techo
(caractere de espaço no final)
Etapa 2: (alterne para o modo de pesquisa estendida para este)
Localizar: "; ?>
Substitua por: ;\n}\n?>
Seguir estes passos irá transformar isto:
[color=#ffb300]Name[/color]
<?php include 'test.php'; echo "$boepsffhfu"; ?>
[color=#ffb300]Name2[/color]
<?php include 'test2.php'; echo "$boepsffhfu"; ?>
[color=#ffb300]Name3[/color]
<?php include 'test3.php'; echo "$boepsffhfu"; ?>
para isso:
[color=#ffb300]Name[/color]
<?php
include 'hostsList.php';
foreach($hosts as $fileName => $bbCode) {
echo $bbCode;
include $fileName;
echo $boepsffhfu;
}
?>
[color=#ffb300]Name2[/color]
<?php
include 'hostsList.php';
foreach($hosts as $fileName => $bbCode) {
echo $bbCode;
include $fileName;
echo $boepsffhfu;
}
?>
[color=#ffb300]Name3[/color]
<?php
include 'hostsList.php';
foreach($hosts as $fileName => $bbCode) {
echo $bbCode;
include $fileName;
echo $boepsffhfu;
}
?>
Se você quiser manter as marcas "
ao redor do texto sendo ecoado, simplesmente remova o "
de cada comando find.