On Fri, Feb 24, 2006 at 11:46:37AM -0700, Alan Young wrote:
> Yeah, that's what I said.  We realized we didn't need it for the
> unique words.  What we were doing originally though was pulling the
> unique occurrences out of a string of text:
> 
> $a = 'abcde' x 200;
> 
> What are the unique occurrences of text in that string?  That's what
> the regex was solving.

Yes, what are the unique occurrences of text in that string?  I've run the
code and I'm still not exactly sure what it's supposed to do.

use Data::Dump qw/ dump /;

$a="abcde"x4;
$a=~s{((\w+?)(??{!$b{$^N}++?"(?=)":"(?!)"}))}{($1)}xg;
print "$a\n";
print dump(\%b), "\n";

(a)(b)(c)(d)(e)(ab)(cd)(ea)(bc)(de)(abc)de
{ a => 3, ab => 2, abc => 1, b => 2, bc => 1, c => 2, cd => 1, d => 3, de
=> 2, e => 3, ea => 1 }

Ronald

Reply via email to