Add polyfills for regex methods