grevory/angular-local-storage — pull request #29 by mwickman (2013-09-22 18:53:55+00:00)
Title: Adding ability to clear local storage based on a regex

This pull request adds the ability to clear an application's local storage based on a regular expression. I added an optional parameter to the clearAllFromLocalStorage function, a regular expression as a string.

It can be used like this:
Acts as normal, clearing all prefixed keys

localStorageService.clearAll()

Clears key which match the prefix then the regular expression. For example, passing "local.*" will match prefix.localData

localStorageService.clearAll("local.*")

This was a feature I needed in another project, so I though it might be useful in the service :)