Wilcard matching

Splash Forums Rewrite Users Wilcard matching

This topic contains 3 replies, has 2 voices, and was last updated by  Christian Kaltepoth 6 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #27211



    Is there any way of doing something like wildcard matching as the Tuckey filter does? I mean using *, **, and $

    Id like to do something like mapping they explain in their Tuckey doc:

    The wildcard matching engine can be used instead of regex. It is supported in conditions and rules where match-type is set to wildcard (or default-match-type is set on the urlrewrite element

    e.g. /big/url/* will match /big/url/abc.html but will NOT match /big/url/abc/dir/ or /big/url/abc/.

    /big/url/** will match /big/url/abc.html, /big/url/abc/dir/ and /big/url/abc/.

    You can also use Regular expression style variable replacement, each match of a * will be available for use in to and set elements using simple $1 $2 variables.

    e.g. /my/big/url/* will match /my/big/url/abc.html and $1 will be set to abc.html.

    Thanks very much

    • This topic was modified 6 years, 7 months ago by  j_l.

    No, Rewrite is based on parameters which are represented by regular expressions. The default pattern for a parameter is [^/]*. But you can change that for each parameter. There is also a special parameter {*} that can be used if you are not interested in what is actually matched. Samples:

    // matches /big/url/foobar but NOT /big/url/foo/bar 
    // same as above
    // matches both /big/url/foobar AND /big/url/foo/bar


    Thanks Christian

    What I can’t do is to store the partial match of a URL in variables like $1 and $2, am I correct?



    You can use the same variable in the to() part like this:

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.