I mean what algorithm does it use to search? (behind) if it's hash? then its always better to compile the string first and use it for search in later point of time, rather than calling re.match every time against whole string
Please share your thoughts.!