Added try-catch for potential NoneType exception for regular expression search