Skip to content

Commit

Permalink
Apply glennake#18
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikNijhuis committed May 28, 2024
1 parent 079f859 commit 665c14b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DirectFire/Converter/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def common_regex():
common_regex.country_code = "(?:[A-Z0-9]{2})"
# common_regex.fqdn = "(.*?)"
common_regex.fqdn = (
"(?=.{4,253}$)(?:(?:(?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63})"
"(?=.{4,253}$)(?:(?:(?!-)[*a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z*]{2,63})"
)
common_regex.fqdn_no_tld = "(?=.{1,253}$)(?:(?:((?!-)[a-zA-Z0-9-]{1,63}(?<!-))|(?:(?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}))"
# common_regex.ipv4 = "(?:[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3})"
Expand Down
2 changes: 1 addition & 1 deletion DirectFire/Converter/parsers/fortigate.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def parse(src_config, routing_info=""):
data["network_objects"][network_object_name]["type"] = "fqdn"

re_match = re.search(
'set fqdn "?(' + common.common_regex.fqdn + ')"?\n', network_object
'set fqdn "?(' + common.common_regex.fqdn + ')"?\n', network_object, re.DOTALL
)

data["network_objects"][network_object_name]["fqdn"] = re_match.group(1)
Expand Down

0 comments on commit 665c14b

Please sign in to comment.