From: David Alan Black Date: 2004-05-12T10:53:51+09:00 Subject: Re: Strange regexp behaviour in gsub Hi -- Kristof Bastiaensen writes: > I was thinking more about something like variable-width look-between :-) > Meaning for example a(?^\w+)b would match any a(.*)b if (.*) is > not equal to (\w+) For that particular case you can use \W (opposite of \w): /a\W*b/ # a + zero or more non-\w + b For more specific cases, you can use a negated character class: /a[^123]*b/ # a + [zero or more of NOT 1,2,3] + b David -- David A. Black dblack@wobblini.net