Thanks Jeff! Works like a charm!

Be well!
/Martin
* Jeff 'japhy' Pinyan ([EMAIL PROTECTED]) wrote:
> On Nov 3, Martin Karlsson said:
> 
> >Could anyone give me a push in the right direction, please?
> >How do I write a regexp that matches double instances of letters (in a
> >file i read into a variable), e.g. aa LL pp etc. ?
> >
> >Is there an easy way, or must I use
> >     (aa|bb|cc|... and so on ) ?
> 
> You want to use a backreference:
> 
>   if ($string =~ /([a-zA-Z])\1/) {
>     # $1 is the character that was doubled
>   }
> 
> -- 
> Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
> RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
> ** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
------------------------------------------------
Martin Karlsson         [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to