PAGE2GO2 HOME | INTERNET NEWS

LeighExchange - Free Advertising Network Stock Research at Internet Speed

Re: Truncating text from a string with beginning text from another

 List
Subject: Re: Truncating text from a string with beginning text from another
Poster: MircoWahabwahab-mail@gmx.de
Date: Fri, 23 Mar 2007 20:28:37 +0100
Related Postings: 1 2 3 4
Mirco Wahab wrote:
> One could rewrite it somehow 'different',
> as a "split", like:
>
> use strict;
> use warnings;
> ...
> [split /$reg/]
> ...

... reg and output slightly modified to match yours:

... no warnings 'qw';

my @end = qw{R e f e r e n c e \\s # \\d+}; my $reg = '\s+('.(join '|',map join('',@$_),map[@end[0..$_]],0..$#end).')$';

while( ) { chomp; print "in : >$_<\n"; print "out: >", (split /$reg/)[0], "<\n" } ...

Regards

M.

 

Page2Go2.com is not responsible for content of this message.