Changeset 1783

Show
Ignore:
Timestamp:
02/23/06 10:34:50
Author:
miyagawa
Message:

fix regexp bug

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Text-Emoticon/trunk/Changes

    r1736 r1783  
    11Revision history for Perl extension Text::Emoticon 
     2 
     30.04  2006-02-23T01:33:54Z 
     4        - Make the regexp greedy, so that it can parse partially 
     5          duplicated patterns in GoogleTalk :( vs. :(|) 
    26 
    370.03  Wed Jan 11 10:21:14 UTC 2006 
  • Text-Emoticon/trunk/lib/Text/Emoticon.pm

    r1736 r1783  
    22 
    33use strict; 
    4 our $VERSION = '0.03'; 
     4our $VERSION = '0.04'; 
    55 
    66use UNIVERSAL::require; 
     
    3434sub pattern { 
    3535    my $self = shift; 
    36     $self->{re} ||= "(" . join("|", map quotemeta($_), keys %{$self->map}) . ")"; 
     36    $self->{re} ||= "(" . join("|", map quotemeta($_), sort { length($b) <=> length($a) } keys %{$self->map}) . ")"; 
    3737    $self->{re}; 
    3838}