Open fundon opened 2 years ago
:name([0-9]+)
For my MQTT usecase I have shared here: https://github.com/viz-rs/path-tree/pull/41#issuecomment-2152654653 there would be the need to have a wildcard which excludes the trailing / when matching.
I have used a named wildcard like this: MQTT/multilevel/:value*
.
this matches topics like:
MQTT/multilevel/
-> value: ""
MQTT/multilevel/a
-> value: "a"
MQTT/multilevel/a/b
-> value: "a/b"
and so on, but the MQTT specification also requires matching of:
MQTT/multilevel
which would result in including the / in the values above and MQTT/multilevel
would be the empty string.
This was and is still "good enough" for me, but it would be nice to have a dedicated matcher or option for this usecase also.
Another nice thing would be an optional "root node", which would allow having routes which don't need a common first character.
Another nice thing would be an optional "root node", which would allow having routes which don't need a common first character.
This was supported in very early versions.
This was and is still "good enough" for me, but it would be nice to have a dedicated matcher or option for this usecase also
I will consider adding this feature.
I know MQTT is not the intended use case, but since the router is very versatile it almost supports it :-) so i just wanted to drop it here for reference. Of course it is up to you to decide the future direction of the project.
''
empty str at top of the tree, replace/
~