oryann9 wrote:
> In this regexp
> 
> my $regexp  = qr/(\d+\x3a1108
>             |\w+\x3a1108{1,} ) /;
> 
> vs.
> 
> my $regexp1  = qr/(\d+\x3a1108
>             |\w+\x3a1108){1,} /;
> 
> does the {1,} construct outside the parens () mean the entire string 1
> or more times and within the parens mean only the last string \x3s1180
> 1 or more times?
> 
> What is the diff?

Modifiers affect the preceding character or grouping so in the first example
the modifier is attached to the character '8' and in the second example the
modifier is attached to the parentheses which will affect the entire contents
of the enclosing parentheses.

Also note that \d is a subset of \w so anything that matches \w will also
match \d.


John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall

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


Reply via email to