C++: Reduce number of regexps.

This commit is contained in:
Geoffrey White
2023-01-13 18:50:30 +00:00
parent 2f09f0e2c1
commit 316117f5c9

View File

@@ -34,7 +34,7 @@ predicate hardCodedAddressOrIP(StringLiteral txt) {
s.matches("\"www.%\"") or
s.matches("\"http:%\"") or
s.matches("\"https:%\"") or
s.regexpMatch("\".*\\." + getATopLevelDomain() + "\"")
s.regexpMatch("\".*\\.(" + concat(getATopLevelDomain(), "|") + ")\"")
)
}