From: Wesley J Landaker Date: 2003-06-01T04:17:26+09:00 Subject: Re: regexp operators On Saturday 31 May 2003 10:35 am, nobu.nokada@softhome.net wrote: > Hi, > > At Sun, 1 Jun 2003 00:10:15 +0900, > > Wesley J Landaker wrote: > > Well, + meaning concatination makes sense to me. What else would it > > mean? Notice that I do put regexps in (?:) groups so that you don't > > have any ambiguity if you do something like: > > > > /foo|bar/ + /.*/ # => /(?:foo|bar)(?:.*)/u > > One possibility: > => /(?:foo|bar).*(?:.*)/u I tend to think of + for regexp to be like + for strings--just a simple concatenation. However, I can see how the above would make sense, if you think of "a + b" as meaning more like "match a, and then match b; what's in between doesn't really matter". If you did that, you'd need some way to do the "a directly followed by b" semantics. I suppose << would work for that, though. =) /foo|bar/ << /.*/ => /(?:foo|bar)(?:.*)/ -- Wesley J. Landaker - wjl@icecavern.net OpenPGP FP: C99E DF40 54F6 B625 FD48 B509 A3DE 8D79 541F F830