refactored the regex pattern to search any spaces within placeholders in the tms url.
only checks for them if they are present in url.
pattern is r".*/\{[zxy]\}/\{[zxy]\}/\{[zxy]\}(?:/|/?)" which ensures placeholders without spaces for all possible combination of them, such as {z}{x}{y}, {x}{y}{z} etc.
Updates:
r".*/\{[zxy]\}/\{[zxy]\}/\{[zxy]\}(?:/|/?)"
which ensures placeholders without spaces for all possible combination of them, such as{z}{x}{y}
,{x}{y}{z}
etc.