in reply to Matching multiple occurences in one string
#!/usr/bin/perl $_ = "abcd bcde cdef defg"; # @x is a array with as much 'cde' scalars as in $_ @x = /cde/g; print "@x\n"; # count how often cde is in $_ $anz = () = /cde/g; print "$anz\n"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Matching multiple occurences in one string
by pepijn (Initiate) on Feb 29, 2004 at 12:25 UTC |