in reply to use regex to split sentence
Also, following on from jryan's idea here is a version that uses split:
$_ = "X1aaX2bbX3heeX4...X5loveUX6XXXX7X8" ; my @match = split /(X\d)/; print "String: " . $_; foreach my $word (@match){ print $word; print "\n" unless $word =~ /X\d/; }
--
John.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: use regex to split sentence
by jryan (Vicar) on Nov 01, 2002 at 18:17 UTC | |
|
Re: Re: use regex to split sentence
by kelan (Deacon) on Nov 02, 2002 at 05:08 UTC |