Skip to content

Instantly share code, notes, and snippets.

@alarsyo
Last active February 7, 2017 18:23
Show Gist options
  • Save alarsyo/831efc5fb76922f90d2b1224f5900786 to your computer and use it in GitHub Desktop.
Save alarsyo/831efc5fb76922f90d2b1224f5900786 to your computer and use it in GitHub Desktop.
TP1 THLR
#!/bin/sh
# EX 1
perl -0777 -pe 's/{.*}/COMMENTAIRE/gsm' exo1/q1
perl -0777 -pe 's/{[^}]*}/COMMENTAIRE/gsm' exo1/q2
# EX 2
perl -0777 -pe 's/"[^"]*"/CHAINE/gsm' exo2/q1
perl -0777 -pe 's/"([^"\\]|\\.)*"/CHAINE/gsm' exo2/q2
# EX 3
perl -0777 -pe 's/ ([sg]et)_([a-zA-Z0-9]+\([^)]*\))/ $1$2/gsm' exo3/q1
perl -0777 -pe 's/ ([A-Z]?)([a-zA-Z0-9_]+\([^)]*\))/ \l$1$2/gsm' exo3/q2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment