aka_bk has asked for the wisdom of the Perl Monks concerning the following question:
Hi, i'm trying to extract names from a string which are separated by dashes. unfortunately perl extracts only the first and then every second one.
$transcript =~ s/\w?/-$1/; #add leading dash $transcript =~ s/ //g; while ($transcript=~/-(.*?)-/msig) { push @analysts, $1; } print "$_\n" for @analysts;
can somebody help? thank you in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: extracting names between symbols
by NetWallah (Canon) on Nov 18, 2009 at 01:28 UTC | |
by aka_bk (Novice) on Nov 18, 2009 at 02:07 UTC | |
by Marshall (Canon) on Nov 18, 2009 at 02:55 UTC | |
by johngg (Canon) on Nov 18, 2009 at 14:10 UTC | |
|
Re: extracting names between symbols
by Marshall (Canon) on Nov 18, 2009 at 00:53 UTC |