John Rudd wrote: > Matt Kettler wrote: > >> Really in regexes there is no such thing as an AND operation. It's just >> not something natural to do in a regex. > > I would argue, at a deeper level of language/grammar theory, that this > isn't true. Instead, AND is implied by concatenation. No it's not. Concatenation is order-specific. AND is order non-specific.
> "X.*Y.*Z" says "X and Y and Z all have to be present". No, it says X and then Y and then Z must all be present in that order > The catch is that an order is implied by the concatenation, Agreed > where we don't always assume an order to AND and OR operators in other > contexts (and the | operator in regex's doesn't impose order, the way > concatenation does). Of course we don't assume order in AND and OR operators. By definition these operators are not order specific. Anything else isn't an AND or OR. > > Which leads to: > >> So in the first chunk, John faked an And. What you really have is two >> expressions that are ORed together. > > The thing that I ORed was the order of the elements, not the ANDing of > elements. No, you created an AND equivalent by ORing two concatenations. > The ANDing of the elements is a natural consequence of the > concatenation. No it's not. Again, concatenation may be "andish" in nature, but it's order specific. Therefore it is not an AND. period. > The first chunk says "maintain and clouds". The second chunk says > "clouds and mountain". > No, the first chunk says "mountain then clouds" the second chunk says "clouds then mountain".