Re: Combining 2 preg matches.



Rik wrote:
Yes and no. It does exactly what you say, but it is simply not valid:

With the pattern:
'/^(?:[a-z0-9]|[a-z0-9][_\-][a-z0-9])+$/';
one states the entire string can be build by either [a-z0-9](1)OR
[a-z0-9][_\-][a-z0-9](2), think of them as blocks.

Let's examine it (not entirely how it works, but this instance close
enough):
(fixed width font is handy now:)
positions: 123456789012345678901234567890
string: really_a_made_up_string
match1: 111111_error, let's try the other option.
match2: 111112--_error, no other matches possible.

There is no possibility for a match with either (1) or (2) at the second _,
and no other options to match instead at the beginning of the string.

Ah! I missed the single letter case.

.



Relevant Pages

  • Re: Speaking of fonts--- and new businesses and such--
    ... diagrams I want to include in the instructions, sigh, and the $$$ to get ... about $60 and you can even get your pattern package (cover, ... if you have a suggestion of a font please let me know. ... Pati, in Phx ...
    (rec.crafts.textiles.quilting)
  • Re: Where to get quality design rulers...
    ... The "square" I was referring to is a ruled right angle aluminum square ... using CAD, the home pattern software seems very limited to me, though I ... is handy to hook on the edge of the cutting mat. ...
    (alt.sewing)
  • Re: Centering Text Not Working
    ... Font doesn't have an alignment property. ... >Private Sub AAA1_Click ... > .Pattern = xlSolid ...
    (microsoft.public.excel.programming)
  • Speaking of fonts--- and new businesses and such--
    ... As some of you know I am in the process of trying to get a pattern company going. ... And I need to decide on a font to use for my pattern covers. ... but I've got GREAT font sites - free fonts that are just awesome! ...
    (rec.crafts.textiles.quilting)
  • Re: Help with events
    ... Font isn't a child of Interior. ... .Pattern = xlSolid ...
    (microsoft.public.excel.programming)