(Mar-09-2020, 07:17 PM)ndc85430 Wrote: It would help to see the code and the full traceback, but why are you trying to do anything with a None
value? If you don't expect it to be None
, then work backwards and find out why it is.
The code below exemplifies the validation of a string through regular expression. If the string is valid it means that the data is safe and if the string is invalid it means unsafe data that is why I need to handle the error for decision making:
import re
ws_string = '/search?keyword=borracha&qt=20&preço=100,00'
ws_text = re.match(r'^[A-ZÁÀÂÃÇÉÊẼÍÓÔÕÚ a-záàâãçéêẽíóôõú0-9/?=&$.,]{1,99}$', ws_string)
ws_output = ws_text.string
if ws_output == ws_string:
print('Security Data')
else:
how to handle the error, because it generates the error quoted in the topic in the terminal ?