From: Jeff Davis Date: 2005-01-27T12:21:35+09:00 Subject: regex questions In python the regexes allow you to call a function instead of just substitute the values (see for more details). That seems quite useful, is there something similar in ruby? Also, let's say I want match anything between "a" and "b" unless it contains the word "foo". I could write two regexes like so: if str =~ /a(.*)b/ and str !~ /a(.*foo.*)b/ Is there a good way to make that kind of logic into one regex? Is there some kind of "intersect" operator or a "not" operator? Regards, Jeff Davis