From: Robert Klemme Date: 2004-05-12T16:38:54+09:00 Subject: Re: Strange regexp behaviour in gsub "Florian Gross" schrieb im Newsbeitrag news:2gd8f2F1gphmU1@uni-berlin.de... > Kristof Bastiaensen wrote: > > > Yes, that would clarify the situation, but is it the correct > > behaviour? I would think that (?!a)a doesn't mean the same > > character, but consecutive ones. Because it doesn't consume > > the character, it effectively is the character 'before' the > > match (if any). The other behaviour wouldn't make sense, > > because (?!a)b is then exactly the same as b. > > I think that it's the intended behavior. Just use /(?!a).b/ if you want > to consume the character. I'd use /[^a]b/ if I wanted to consume the character. No need for negative lookahead here. robert