Perl Programming | ||
---|---|---|
Regular Expressions | ||
my $breakfast = 'Lox Lox Lox lox and bagels'; $breakfast =~ s/Lox //g; print "$breakfast\n"; my $paragraph = "First Line\nSecond Line\nThird Line\n"; my ($first, $second) = ($paragraph =~ /(^.*$)\n(^.*$)/m); print "$first, $second\n"; lox and bagels First Line, Second Line |
||
Previous | http://stuff.mit.edu/iap/perl/ | Next |