>>>>> "Sean" == Sean M Burke <[EMAIL PROTECTED]> writes:

Sean> I was working on a CM-to-regexp translator, which I think I have
Sean> working right, by the way -- for XML content models, that is -- SGML
Sean> CMs permit the & operator, which has no straightforward equivalent in
Sean> rexexp.  This was so HTML::AsSubs could do runtime checking of content
Sean> models.  (A feature I've not yet gotten around to adding.)

I don't know what & does in an SGML CM, but if you need an "and"
in a regex, just use zero-width positive lookahead:

        / (?= .*? foo) (?= .*? bar) /x

True iff there is both a foo and a bar somewhere in the string.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to