mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-12 15:51:58 +02:00
Fix #106: node tag matching.
Text values was treated as regular expressions.
This commit is contained in:
parent
5ecbb3f349
commit
60836bf2f7
1 changed files with 6 additions and 5 deletions
|
@ -68,11 +68,12 @@ def is_matched_tag(
|
|||
return MatchingType.MATCHED_BY_WILDCARD, []
|
||||
if tags[matcher_tag_key] == matcher_tag_value:
|
||||
return MatchingType.MATCHED, []
|
||||
matcher: Optional[re.Match] = re.match(
|
||||
matcher_tag_value, tags[matcher_tag_key]
|
||||
)
|
||||
if matcher:
|
||||
return MatchingType.MATCHED_BY_REGEX, list(matcher.groups())
|
||||
if matcher_tag_value.startswith("^"):
|
||||
matcher: Optional[re.Match] = re.match(
|
||||
matcher_tag_value, tags[matcher_tag_key]
|
||||
)
|
||||
if matcher:
|
||||
return MatchingType.MATCHED_BY_REGEX, list(matcher.groups())
|
||||
|
||||
return MatchingType.NOT_MATCHED, []
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue