August 1998
Intermediate to advanced
800 pages
39h 20m
English
We have found these regular expressions useful or interesting.
m/^m*(d?c{0,3}|c[dm])(l?x{0,3}|x[lc])(v?i{0,3}|i[vx])$/is/(\S+)(\s+)(\S+)/$3$2$1/
m/(\w+)\s*=\s*(.*?)\s*$/ # keyword is $1, value is $2
m/.{80,}/m|(\d+)/(\d+)/(\d+) (\d+):(\d+):(\d+)|
s(/usr/bin)(/usr/local/bin)g
s/%([0-9A-Fa-f][0-9A-Fa-f])/chr hex $1/ge
s{
/\* # Match the opening delimiter
.*? # Match a minimal number of characters
\*/ # Match the closing delimiter
} []gsx;s/^\s+//; s/\s+$//;
s/\\n/\n/g;
s/^.*:://
# XXX: fails on legal IPs 127.1 and 2130706433.
m{
^ ( \d | [01]?\d\d | 2[0-4]\d | 25[0-5] )
\˙ ( \d | [01]?\d\d | 2[0-4]\d | 25[0-5] )
\˙ ( \d | [01]?\d\d | 2[0-4]\d | 25[0-5] )
\˙ ( \d | [01]?\d\d | 2[0-4]\d | 25[0-5] )
$
}xs(^.*/)()
$cols = ( ($ENV{TERMCAP} || " ") =~ m/:co#(\d+):/ ) ? $1 : 80;($name = " $0 @ARGV") =~ s, /\S+/, ,g;
die "This isn't Linux" unless $^O =~ m/linux/i;
s/\n\s+/ /g
Read now
Unlock full access