Skip to content

Commit 2c541e5

Browse files
committed
use constants
1 parent 5d0b439 commit 2c541e5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/google-api-core/google/api_core/path_template.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,16 @@ def replacer(match):
141141

142142
if positional == "*":
143143
wildcard_types.append("*")
144-
return r"([^/]+)"
144+
return _SINGLE_SEGMENT_PATTERN
145145
elif positional == "**":
146146
wildcard_types.append("**")
147-
return r"(.+)"
147+
return _MULTI_SEGMENT_PATTERN
148148
elif not template or template == "*":
149149
wildcard_types.append("*")
150-
return r"([^/]+)"
150+
return _SINGLE_SEGMENT_PATTERN
151151
elif template == "**":
152152
wildcard_types.append("**")
153-
return r"(.+)"
153+
return _MULTI_SEGMENT_PATTERN
154154
else:
155155
sub_pattern, sub_types = _build_capture_pattern(template)
156156
wildcard_types.extend(sub_types)

0 commit comments

Comments
 (0)