[ create a new paste ] login | about

Link: http://codepad.org/fD1dAfAa    [ raw code | output | fork ]

Perl, pasted on Dec 11:
1
2
3
4
5
6
7
8
9
10
11
12
my $regex = qr/(ABC\w+)/;
$/ = "\r\n";
$\ = "\n";

$_ =~ $regex and print $1 while ( <DATA> );

__DATA__
insert_pack: ABChello_1 pack_type: b
insert_pack:ABChello_2 job_type:b
insert_pack:ABChello_3 pack_type:b 
ABChello_4 test_type
DEFhello_5


Output:
1
2
3
4
ABChello_1
ABChello_2
ABChello_3
ABChello_4


Create a new paste based on this one


Comments: