Script Regex, para el uso de expresiones regulares en Perl


(English version at the end)

Este es el script Regex, que durante años hemos usado en clases para enseñar a aplicar expresiones regulares en Perl. Se trata de un script muy sencillo que abre un archivo de texto e imprime líneas o segmentos en función de una expresión regular proporcionada por el usuario. Es básicamente como un grep, pero más fácil de adaptar a diversas situaciones.

Por el momento el script viene en dos versiones:

Una versión ultrasimple:
http://www.tecling.com/scriptregex/scriptregex.zip

y una versión semiadecentada:
http://www.tecling.com/scriptregex/scriptregex-semi-decent-version.zip

Quienes usan por primera vez este tipo de herramientas probablemente van a preferir la primera. Pero apenas se gane un poco de experiencia es recomendable pasar a la segunda. La única diferencia es que la segunda versión utiliza el strict pragma, que hace el código más seguro.


Tenemos un video de YouTube (en castellano) con una introducción al uso de expresiones regulares y una muestra de cómo utilizar este script:

TECLING 2023.
Concepto y desarrollo: Rogelio Nazar


English Version
This is Regex script, which we have used for years in classes to teach how to apply regular expressions in Perl. It is a very simple script that opens a text file and prints lines or segments based on a regular expression provided by the user. It is basically like a grep, but more malleable. You can easily change a few lines of code to adapt it to different situations.

At the moment the script comes in two versions:

An ultra-simple version:
http://www.tecling.com/scriptregex/scriptregex.zip

and a semi-decent version:
http://www.tecling.com/scriptregex/scriptregex-semi-decent-version.zip

If it is your first time with this kind of things, it is better to opt for the first one. But as soon as you gain some experience, it is highly recommended to move on to the second one. The only difference between the two is that the latter uses the strict pragma, which makes the code safer.
If you have any questions, you are encouraged to send email to rogelio dot nazar at pucv dot cl