How to Solve NameError: name 'search' is not defined -- re

Solution: Import the 'search' module

To Solve the error, add the following line to the top of your code.

from re import search

 

For more information:
Python re search