preact-router icon indicating copy to clipboard operation
preact-router copied to clipboard

Match component regex/wildcard matching?

Open IrregularShed opened this issue 8 years ago • 1 comments
trafficstars

Would there be any mileage/interest in altering this so that the matching can support wildcards (probably with a regex)? I suppose the issue would potentially be handling the values that the wildcards are matched against - for my current use case that's not an issue but I can imagine somebody wanting to do something like this if the option is there.

https://github.com/developit/preact-router/blob/e73850430e32b61677d5cbcacd91ef2a81e89358/src/match.js#L22

IrregularShed avatar Aug 11 '17 14:08 IrregularShed

Maybe we could allow a function or regex in addition to a pattern string? Could just let the regex matches be passed down as numeric properties.

developit avatar Sep 08 '17 22:09 developit