Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

RE: RE: Re: removing duplicate letters

by takshaka (Friar)
on Jun 19, 2000 at 01:53 UTC ( [id://18735]=note: print w/replies, xml ) Need Help??


in reply to RE: Re: removing duplicate letters
in thread removing duplicate letters

If we're going to be pedantic, \w matches nonletters as well. Use a character class with the appropriate definition of "letters".

s/([a-zA-Z])\1/$1/g;

Replies are listed 'Best First'.
RE: RE: RE: Re: removing duplicate letters
by mdillon (Priest) on Jun 19, 2000 at 05:39 UTC

    if you want to talk about pedantic, your letters may not be the letters everyone else is using, so to take the locale into effect, you could do something like the following:

    s/([^\W\d_])\1/$1/g

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://18735]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-25 12:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found