Skip to content

Commit e4d7c56

Browse files
eredi93Edmund Dipple
authored andcommitted
fix multiline regex (elmundio87#14)
1 parent 6f4da50 commit e4d7c56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

terraform_validate/terraform_validate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,10 @@ def get_regex_matches(self, regex, variable):
406406
regex = "^" + regex
407407

408408
p = re.compile(regex)
409-
return p.match(str(variable))
409+
variable = str(variable)
410+
if '\n' in variable:
411+
return p.match(variable, re.DOTALL)
412+
return p.match(variable)
410413

411414
def get_terraform_variable_name(self, s):
412415
return self.get_regex_matches('\${var.(.*)}', s).group(1)

0 commit comments

Comments
 (0)