diff --git a/goggles/quickstart.goggle b/goggles/quickstart.goggle index cf65a3f..a83e298 100644 --- a/goggles/quickstart.goggle +++ b/goggles/quickstart.goggle @@ -37,9 +37,35 @@ /this/is/*/pattern ! The special character '^' can be used to indicate that an URL delimiter such -! as '/' or end-of-url can be matched (note: the number of carets allowed in a -! given instruction is limited): +! as '/' or end-of-url can be matched. More specifically, '^' is equivalent to +! the regexp: [^\w\d._%-]|$ +! +! This means that it can match either the end of the URL or any character that is +! not a letter, digit, dot, underscore, percent sign or dash. Here are a few +! examples of characters that are matched by '^': / (slash), = (equal), +! [ (bracket), : (colon), etc. +! +! In practice, you will usually want to use '/' (or any other specific +! separator like '=' or '?') most of the time in your patterns, except at the end +! of a pattern in cases where you want to be a little bit more generic, and +! express that your pattern should be either matching at the end of the URL or be +! followed by a separator and then arbitrary URL components. +! +! For example, |https://example.org^ will match: 'https://example.org', +! 'https://example.org/' or 'https://example.org/path'; but it will *not* match +! 'https://example.org.ac', which is also a valid domain name starting with +! 'https://example.org'. +! +! Another example, /foo.js^ will match: 'https://example.org/foo.js', +! 'https://example.org/foo.js?param=42', 'https://example.org/foo.js/' but it +! will *not* match 'https://example.org/foo.jsx' (because it is not followed by a +! separator). +! +! Also note that the maximum number of carets allowed in a given instruction is +! limited. /this/is/a/pattern^ +|https://example.org^ +/foo.js^ ! By default, a pattern can match anywhere in the URL, but there are specific ! characters which can be used to indicate prefix or suffix matches: we call them