Added some helper methods for regex.