Eirik Berg Hanssen <[EMAIL PROTECTED]> writes:

> Rod Adams <[EMAIL PROTECTED]> writes:
>
>> Eirik Berg Hanssen wrote:
>>
>>>Rod Adams <[EMAIL PROTECTED]> writes:

>>>>    $re1 = /^ <-[x]>* x <-[x]>* $/; # match a string with exactly one
>>>>'x' in it.
>>>>    $re2 = /^ <-[y]>* y <-[y]>* $/; #  ditto 'y'
>>>>    $re3 = /^ <-[z]>* z <-[z]>* $/; #  ditto 'z'

>>>>    $re7 = none($re1, $re2, $re3); # matches if there are 0 or 2+ of
>>>>each of x,y,z.


>>>$re7 = /^ <!before <$re1> | <$re2> | <$re3> > /;


>> That doesn't quite do it, but something along those lines is
>> possible. You'd have to make sure the look ahead/behinds match to the
>> end of the string, not just some substring. And then you'd have to put
>> in something to actually match the string. So possible, but not
>> straightforward in the least.
>
>   $re1, $re2, and $re3 are already anchored: Covered.
>
>   And it will match the empty string at pos()==0, given that the
> assertion is satisfied.  This of course differs from a junction of
> three match objects, each matching the whole string at pos()=0,

  Whoops again: That would be a junction of three match objects,
_none_ of which are successful.  When the assertion is not satisfied,
however, you will be able to inspect the match object junction's
states to see how many of the $re\d matched, and in the general case,
how they matched.  But on the whole, I now get the impression that
these match object junctions (or at least match object injunctions)
would rarely be used outside boolean context.


Eirik
-- 
For every complex problem, there is a solution that is simple, neat, and wrong.
                -- H. L. Mencken
A good plan today is better than a perfect plan tomorrow.
                -- Patton

Reply via email to