[clug] (no subject)

Gough, Chris Chris.Gough at cit.act.edu.au
Tue Feb 3 05:20:03 GMT 2004


Soon after, Paul Bryan wrote
>On Tue, Feb 03, 2004 at 02:24:22PM +1100, Gough, Chris wrote:
>> For example:
>>  A = '^.*$'
>>  B = '^foo$'
>
> C = '(A|B)'
> or more clearly:
> C = '(^.*$|^foo$)'
> aPatternExists(C)
<snip>
> Hope that works - I didn't try it, but I can't see why not.
Thank's Paul, it'll work but it won't answer my question.

I can not think of a regex that will not match at least one pattern
(remember, my head's already hurting). If there is always at least one
pattern that will match a regex, then there is always at least one pattern
that will be matched by regex A or regex B. I think your test will always
yeild true.

A = '^foo$'
B = '^bar$'
// the following is true
aPatternExistss('(^foo$|^bar$)')

... yet there is no string that is both 'foo' and 'bar', so it's answering a
different question to the one I want.


Chris

This email, and any attachments, may be confidential and also privileged.
If you are not the intended recipient:

Please notify the sender and delete all copies of this transmission along
with any attachments immediately.
You should not copy or use it for any purpose, nor disclose its contents to
any other person.


More information about the linux mailing list