pere.noel
1/26/2006 7:24:00 PM
i want to find a regexp avoiding to apply two times a entity transform
for the cases :
' or '
&
>
<
"
i found a way :
txtout=txtin.gsub(/&[^#aglq]/, "&")
which works, by chance, over the cases i have ))
the prob comes because the negate symbol ^ applies to the list of chars,
each individualy, following it. Then if i have a string including &a
(with my regex) the & will not be transformed to &, which is
wrong...
i'd like to know a way to say :
match & not followed by :
#\d\d;
amp;
gt;
lt;
quot;
i think this is only possible using back reference, that's to say ;
after having matched amp; (for example) negate the previous matching of
&...
but i don't know how to do that ))
--
une bévue