I guess the RegEx re.VERBOSE flag is not supported by Skulpt?
Code Sample:
file_name_regex = re.compile(r'(\w*\.\w*)', re.VERBOSE)
mo = file_name_regex.search('Test.csv') # mo = match object
print("mo1:", mo) # mo1: <re.Match object; span=(0, 24), match='Test.csv'>
# Regex in one line works
file_name_regex = re.compile(r'''(
\w*\ #filename
\.\w* # extensie
)''', re.VERBOSE)
mo= file_name_regex.search('Test.csv')
print("mo2:", mo) # mo2: None
# Same Regex spread over several lines does not work