and regexes?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Suppose that I have two regexs, I can use | to or them. Is there a way
to and them? Thanks!

Re: and regexes?

Quoted text here. Click to load it

Be more specific. There are many ways to 'and' regexes, which is why
there isn't a single operator.

Do you want the matches to happen one after another, or do you want them
both to start at the same point? If the latter, do you want to insist
that both patterns matched the same text? If not, where should
subsequent parts of the pattern pick up the match?

I suspect that whatever it is you're trying to do, the (?=) lookahead
construction is what you need to do it.


Site Timeline