in reply to Re^2: Can you do "conjunctive" (overlapping) conditions in a single regexp?
in thread Can you do "conjunctive" (overlapping) conditions in a single regexp?

You can't use the first version.

You can use the second version like you did before. Just put the (?=) around the whole thing and insert whatever you want for the pattern in the middle.

It is ugly but conceptually is not that bad. The first code pattern stores the position of the start of the match in $^R. The second one looks at the current position and the start (which is in $^R) and decides whether or not to make the match fail by interpolating in something that can't match. There are some complication around the logic, but that doesn't need to change.

  • Comment on Re^3: Can you do "conjunctive" (overlapping) conditions in a single regexp?

Replies are listed 'Best First'.
Re^4: Can you do "conjunctive" (overlapping) conditions in a single regexp?
by puterboy (Scribe) on Dec 18, 2008 at 05:52 UTC
    Thanks so much for the help & explanation!!!

        Lexical variables work fine if they're declared in the block. If they're declared outside the block, the block becomes a closure.

        I wouldn't use a bare our, though. I use local our. See the first post in this thread for an example.