On 7/16/07, yitzle <[EMAIL PROTECTED]> wrote:
> [ and ] define a character class and ^ means something different inside a
> character class.  You need to use alternation instead.
>
> =~ /(?:^|&)limit=([0-9]{1,3})(?:&|$)/

I thought ^ inside [] only meant 'something special' if it was the
first character.
Can you explain what '?:' means?

When ^ isn't the first character in a class it means nothing special.
That is the problem.  Outside of a character class it means
start-of-string* which is special.  (?:) is a non-capturing grouping.
It allows you to group things (like the or'ed patterns /^/ and /&/)
without setting $1 and its friends.

* or start-of-line if the m option is set, or either if both the m and
s options are set.

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


Reply via email to