Re: OT: RE madness

2003-01-08 Thread andrej hocevar
On Tue, Jan 07, 2003 at 10:55:54AM -0600, will trillich wrote: [...] > slight rewording needed -- "black" comes back as true BECAUSE IT > DOESN'T MATCH, and that's what you're looking for with !~. it > might seem like a small distinction until you realize how easy > it is to be misled! :) Right, so

Re: OT: RE madness

2003-01-07 Thread will trillich
On Mon, Jan 06, 2003 at 11:40:08PM -0200, andrej hocevar wrote: > I've been playing around with these two REs in Perl with no > success. Can anyone tell me what's wrong? > > This works: > !~ /^(?:red|blue)$/ $var !~ // ==> var as no match for expression /^$/ ==> match expression

Re: OT: RE madness

2003-01-06 Thread Colin Watson
On Mon, Jan 06, 2003 at 11:40:08PM -0200, andrej hocevar wrote: > I've been playing around with these two REs in Perl with no > success. Can anyone tell me what's wrong? Derrick has nailed it, I believe, so I won't go over that again. > which fails. Why is this? Is there no way of saying "neither

Re: OT: RE madness

2003-01-06 Thread Derrick 'dman' Hudson
On Mon, Jan 06, 2003 at 11:40:08PM -0200, andrej hocevar wrote: | Hello. | I've been playing around with these two REs in Perl with no | success. Can anyone tell me what's wrong? Disclaimer: I assume !~ means "does not match". (I don't do perl) (However, I know that =~ means "matches")

OT: RE madness

2003-01-06 Thread andrej hocevar
Hello. I've been playing around with these two REs in Perl with no success. Can anyone tell me what's wrong? This works: !~ /^(?:red|blue)$/ and will match everything except any of the two fixed strings "red" or "blue" or any combination thereof. "black" matches, as does "blu", because it's neith