Solved: sort regex trouble!

2002-04-25 Thread Martin A. Hansen
hi i finally got it to work. it was very simple ... _if_ you remember that its not but you are trying to match! martin On Wed, Apr 24, 2002 at 11:04:42AM -0400, David Gray wrote: > > >May I suggest: > > >(my $A = $a) =~ s/^(\d+)<\/td>/$1/; > > >(my $B = $b) =~ s/^(\d+)<\/td>/$1/; > > > >

RE: sort regex trouble!

2002-04-24 Thread David Gray
> >May I suggest: > >(my $A = $a) =~ s/^(\d+)<\/td>/$1/; > >(my $B = $b) =~ s/^(\d+)<\/td>/$1/; > > That's not what he's doing. He's doing: > > my ($A) = $a =~ m{^(\d+)}; > my ($B) = $b =~ m{^(\d+)}; > > Yours leaves everything after the tacked onto the end > of $A; mine and his only sto

RE: sort regex trouble!

2002-04-24 Thread Jeff 'japhy' Pinyan
On Apr 24, David Gray said: >> > sub by_number_of_citations >> > { >> >$a =~ /\(.*?)\<\/td\>/; >> >my $A = $1; >> >$b =~ /\(.*?)\<\/td\>/; >> >my $B = $1; >> > >> >$B <=> $A; >> > } > >May I suggest: >(my $A = $a) =~ s/^(\d+)<\/td>/$1/; >(my $B = $b) =~ s/^(\d+)<\/td>/$1/; Th

RE: sort regex trouble!

2002-04-24 Thread David Gray
> > im trying to sort out this sort routine: > > the sub by_number_of_citations works > > but if i try to make a sort alphabetically, my regex fails? > > how should it be done? > > > > # sting to match: 1212Cited > > Work121232< /td>1999 > > > > # sort routine > > # > > sub by_number_of_citations

Re: sort regex trouble!

2002-04-23 Thread bob ackerman
On Monday, April 22, 2002, at 06:01 AM, [EMAIL PROTECTED] wrote: > hi > > im trying to sort out this sort routine: > > the sub by_number_of_citations works > > but if i try to make a sort alphabetically, my regex fails? > > how should it be done? > > > martin > > > > # sting to match: 1212Cited

sort regex trouble!

2002-04-23 Thread maasha
hi im trying to sort out this sort routine: the sub by_number_of_citations works but if i try to make a sort alphabetically, my regex fails? how should it be done? martin # sting to match: 1212Cited Work1212321999 # sort routine # sub by_number_of_citations { $a =~ /\(.*?)\<\/td\>/;