
7stud
Enthusiast
Dec 2, 2009, 5:06 PM
Post #2 of 2
(5304 views)
|
Re: [reverend] help with use all cells of array in regex
[In reply to]
|
Can't Post
|
|
use strict; use warnings; use 5.010; my $str =<<ENDOFSTR; hello, monkey bye; monkey bye, dog; cat end ENDOFSTR my @arr = ('monkey', 'cat'); my $count = 0; for (@arr) { $count++ while ($str =~ /[,;]\s+$_/g) ; } say $count; --output:-- 3
(This post was edited by 7stud on Dec 2, 2009, 5:07 PM)
|