fix cache clear with regex and tests

Discussion here: https://groups.google.com/forum/?fromgroups#!topic/web2py/72vUKgyDkxQ