in reply to Using regex to match double letters, and only double letters

You need to use capturing parentheses, and then backreference. EG:
#!/usr/bin/perl -w use strict; while (<DATA>) { next if ($_ !~ /([A-Za-z])\1/); print; } __DATA__ balloon hello world foo bar perlmonks merry christmas

Which gives:

balloon hello foo merry

See perlre for more information.

Hope this helps,
Darren :)

Replies are listed 'Best First'.
Re^2: Using regex to match double letters, and only double letters
by kwaping (Priest) on Dec 30, 2005 at 02:51 UTC
    Good solution! I couldn't help but golf it a little. :)
    #!/usr/bin/perl -w use strict; while (<DATA>) { print if (/([a-z])\1/i); } __DATA__ balloon hello world foo bar perlmonks merry christmas
Re^2: Using regex to match double letters, and only double letters
by Anonymous Monk on Dec 30, 2005 at 02:07 UTC
    That helps immensely, thank you very much indeed. Why I didn't think of that, I shall never know.
      deleted
      the hardest line to type correctly is: stty erase ^H
        That will give you two letters, but not two doubled letters (aa, bb, cc, etc.). I think you just misunderstood the OP.