#!/usr/bin/perl -w use strict; my $regexp = qr{some regexp}o; open (FILE, 'some.file') or die "Can't open file.\n"; undef $/; my $file = <FILE>; close FILE; while ($file =~ /$regexp/g) { print "$1\n"; }
In reply to Best way to get all of the matches? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |