Use wildcards to match groups of similar URLs. For example, only show the Drip widget on the "/blog" subdirectory of your site.
Here's an example of a URL containing a subcategory:
https://drip.com/blog
The “blog” subcategory contains a number of blog posts. To reference every single blog post contained in that subcategory, apply a wildcard to the URL.
Here's an example of a wildcard for the “/blog” subdirectory:
https://drip.com/blog/**
There are two kinds of wildcards:
- Single asterisk(*)
- Double asterisk(**)
Single Asterisk Wildcards
The single asterisk matches an individual URL segment.
For example:
- ".../blog/*" matches ".../blog/basic”
- But ".../blog/*" does not match “/blog/basic/123".
Double Asterisk Wildcards
The double asterisk(**) wildcard matches one or more URL segments.
For example, "/blog/**" matches both:
- "/blog/123
- “/blog/category/marketing/1234".
Mix Wildcards Together
Here are a few examples of how to mix wildcards together:
- Use the single asterisk(*) wildcard in the query string
- For example: /blog/**?s=* matches any page under the blog subdirectory with the query string parameter set to anything.
- /blog/**?s=* will work for both:
- “../blog/category/marketing/?s=1234”
- “../blog/category/?s=1234”
- /blog/*?s=*
- Will work for: “../blog/category/?s=1234”
- But it will not work for: “../blog/category/marketing/?s=1234”
- /blog/**?s=* will work for both:
- For example: /blog/**?s=* matches any page under the blog subdirectory with the query string parameter set to anything.
- Phrases wrapped in square brackets, [ ], are interpreted as Regular Expressions, which helps prevent encoding your links.
- For example, we will translate `https://drip.com/[(help|support)]` into "https://drip.com/(help|support)" instead of encoding it to something like “https://drip.com/(help%7Csupport)”
- Phrases wrapped in parenthesis, (), can be used as an OR condition where | acts as the “or”.
- For example, you can use `https://drip.com/(help|support)` to target either/both of these pages:
- https://drip.com/help
- https://drip.com/support
- For example, you can use `https://drip.com/(help|support)` to target either/both of these pages: