Perl programming on MPE/iX - February 2001
February 9, 2001
Solution Symposium
Page 19
hp e3000
perl
programming
using regular expressions
$showme=`callci showme`;
if ($showme =~ /RELEASE: ([A-Z]\.(\d)(\d)\.\d\d)/) {
$release = $1; # the matching V.UU.FF
$mpe = "$2.$3"; # the matching U and U (i.e. 7.0)
}
$showme =~ s/LDev/Logical Device/gi; # global substitution
• $n contains the value of the n-th matching parenthesized regexp
• the g suffix causes a global substitution
• the i suffix causes case-insensitive matching