Re: regexp



Number one will match:
\d+\x3a1108
or
\w+\x3a1108 at least once

Number two will match:
(\d+\x3a1108|\w+\x3a1108) at least once

so yes the {1,} outside means the whole thing and {1,} inside means only the
part after the or (pipe '|' sign) unless my regex skills are completely
deserting me after a whole day of work...

Regards,

Rob

On 1/31/07, oryann9 <oryann9@xxxxxxxxx> 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?

thank you.


---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.



Relevant Pages

  • Re: regexp
    ... does the construct outside the parens mean the entire string 1 ... modifier is attached to the parentheses which will affect the entire contents ...
    (perl.beginners)
  • Re: regexp
    ... does the construct outside the parens mean the entire string 1 ... modifier is attached to the parentheses which will affect the entire contents ...
    (perl.beginners)
  • Re: regexp
    ... does the construct outside the parens mean the entire string 1 or more times ... No, not the whole string, just the last character, which is 8 (not 0 ...
    (perl.beginners)
  • Re: Regexp, ***= and subexpressions
    ... specified that the user's input be treated as a literal string rather than ... -exact] in cases where regexp isn't required:P ... Seems to be that regexp can't match word boundaries at "non-word" ... But now Earth has rotated and I can get back to sleep. ...
    (comp.lang.tcl)
  • Re: Regexp: Case-insensitive matching | N factorial
    ... a regexp component that matches a string of letters, ... Will match the string 'cat' anywhere it appears regardless of case. ... Javascript regular expressions have an alternative operator '|' (kind ...
    (comp.lang.javascript)