Ian's Web Server

WebExpr

WebExpr is a simple tool that brings the power of grep, sed, and tr to the cloud. It functions by creating a rudimentary language for passing expressions to these command that anyone can learn in a few minutes. WebExpr is very useful for automating annoying data processing tasks frequently done by hand. Here is an example expression list. (Here is a more complex one.)

S EXPRESSION - Execute EXPRESSION in sed. For instance, "S s/TEST/TEXT/g" replaces all instances of TEST with TEXT.
G PATTERN - Search for PATTERN. For instance, "G cheese" prints all lines containing cheese.
E TEXT - Search for TEXT. For instance, "E /etc/passwd" prints all lines containing /etc/passwd, regardless of any special meanings of "/".
V PATTERN - Delete all lines matching PATTERN. For instance, "V cheese" deletes any lines containing cheese.
T CHAR1->CHAR2 - Replace character CHAR1 with CHAR2. For instance, "T \n->\t" replaces all newlines with tabs.
D CHAR - Delete all instances of CHAR. For instance, "D \r" converts a Windows text file into a Linux one.
You can create comments by putting a # before the comment.


If you would like to install WebExpr on your system as an interpreter, download this file and move it to /usr/bin or another executable path as wexp. Then add it to the top of an expression list as #!/usr/bin/wexp. Expression lists read from STDIN and output to STDOUT, but they can also read a file passed as an argument instead.


Input content:

Expression list: