dreamy has asked for the wisdom of the Perl Monks concerning the following question:
it should return:my $a = qq(foo bar foo bar foo bar foo bar foo bar); $a =~ s/HELP HERE{4}.+/$1.../g; # <<< this is the problem print $b;
foo bar foo bar...
can this be done with one nice regex ? :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: get first e.g. 5 words and replace the remaining string with ... with one regex
by LAI (Hermit) on Jan 28, 2003 at 14:26 UTC | |
|
Re: get first e.g. 5 words and replace the remaining string with ... with one regex
by bart (Canon) on Jan 28, 2003 at 14:46 UTC | |
|
Re: get first e.g. 5 words and replace the remaining string with ... with one regex
by diotalevi (Canon) on Jan 28, 2003 at 14:36 UTC | |
|
Re: get first e.g. 5 words and replace the remaining string with ... with one regex
by robartes (Priest) on Jan 28, 2003 at 14:29 UTC |