Ryan Dillinger wrote:
Hello All,
I was studying some pattern matching. And I ran into this piece of code.
Now I believe I understand it up until the the last part \1.
Can someone explain it for me please?
Match lowercase a through z, uppercase A through lc z
no more than three times, with white space zero or one times
then I'm stumped, what's the 1 for?

/([a-zA-z]{3})\s*\1/

Hi Ryan

What everybody else said, plus:

The {3} means /exactly/ three times, no more or less.

  /[a-zA-Z]{0,3}/

would mean between 0 and three times.

  /[a-zA-Z]{1,3}/

between 1 and 3 times. Et cetera.

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to