"John W. Krahn" <[EMAIL PROTECTED]> wrote:    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
-- 

  ok did not know the subset info.  
  thx agn!




  
---------------------------------
Looking for earth-friendly autos? 
 Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.  

Reply via email to