Add the requirement that it has to be anchored at the end, and you will get the longest match. Try /(ot|foot|refoot)$/ and see which one matches. Bet ya its the longest one.
-Blake
Comment on Re: Re:{4} Getting impossible things right (behaviour of keys)