This supports full regex Patterns with named capturing groups that can be used with Scala String Interpolation
This supports full regex Patterns with named capturing groups that can be used with Scala String Interpolation
e.g.:
/path/(?<$rest>.+) ==> Will match /path/to/somewhere with the "to/somewhere" being bound the the "rest" variable
This support simple patterns of the form: /path/$part ==> Will match /path/foo, /path/bar, etc...
This support simple patterns of the form: /path/$part ==> Will match /path/foo, /path/bar, etc... /path/$part* ==> Will match /path/to/somewhere, /path/foo/bar, /path/foo, etc...
By default a variable will match everything up to the next / character. If the * is used then the / character is also included.
Other simple regex operators are also now supported:
/path/$part/? ==> Allow an optional trailing slash /path/$part.(gif|jpg) ==> Allows either gif or jpg extension
These are operators are supported: ( ) | ?
The group operator will be re-written as a non-capturing group.
However those operators must be self-contained within each part of the string. This means you can't have something like:
/path(/$part)? ==> DOES NOT WORK - The grouping operator spans multiple parts of the string
TODO: make this work with query params. e.g.: /path/$var?foo=$foo