fix cache clear with regex and tests
Merge pull request #563 from ilvalle/fix-cache

fix cache clear with regex and tests