Implemented Regex into the refresh function.