[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: REGEX question



On 21/01/02 Alec did speaketh:

> Hi
> 
> How can I match the same character repeated n times?
> ".{n}" matches any n characters.

How about this:

/(.)\1{n-1}/

I'm assuming perl syntax, so adjust accordingly.

Mike

-- 
Michael P. Soulier <msoulier@mcss.mcmaster.ca>, GnuPG pub key: 5BC8BE08
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to Unix

Attachment: pgpKmXcjik4qM.pgp
Description: PGP signature


Reply to: