so i have lots of regular expressions, and i keep getting error according to global flags must be at the start of the regular expressions, is there any way to fix this problem or maybe somehow find global flags from the RE and then insert them at the start of my RE? or it makes a different matching pattern?
can i somehow use this solution?
regex = "^[s]*max_log_file_action[s]*=[s]*(?i)keep_logs(?-i)[s]*$"
# turns to
regex = "(?i)^s*max_log_file_actions*=s*keep_logss*$"
or after changing i won’t get the same results?
if re.search(regex, string, re.MULTILINE | re.IGNORECASE):
print("passed")
but i’ve got this error again:
raise source.error('global flags not at the start '
re.error: global flags not at the start of the expression at position 36
and here’s the one of my regexes:
regex = "^[s]*max_log_file_action[s]*=[s]*(?i)keep_logs(?-i)[s]*$"