diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2025-02-03 12:56:57 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-02-05 12:35:17 +0000 |
| commit | a984531ce57f30bc9ec7f664e7c2e8c77b3f439e (patch) | |
| tree | c9533c6289d41e1b34e80bb003bf89ba6ffe4556 /doc | |
| parent | config: remove debug logging (diff) | |
url-mode: use the first *sub* expression as URL
When auto-matching URLs (or custom regular expressions), use the
first *subexpression* as URL, rather than the while regex match.
This allows us to write custom regular expressions with prefix/suffix
strings that should not be included in the presented match.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/foot.ini.5.scd | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index af355d68..742281d4 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -786,11 +786,13 @@ section. Default: _sadfjklewcmpgh_. *regex* - Regular expression to use when auto-detecting URLs. The format is - "POSIX-Extended Regular Expressions". + "POSIX-Extended Regular Expressions". Note that the first marked + subexpression is used a the URL. In other words, if you want the + whole regex matćh to be used as an URL, surround all of it with + parenthesis: *(regex-pattern)*. - Default: _([a-z][[:alnum:]-]+:(/{1,3}|[a-z0-9%])|www[:digit:]{0,3}[.])([^[:space:](){}<>]+|\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))\*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))\*\])+(\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))\*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))\*\]|[^]\[[:space:]`!(){};:'".,<>?«»“”‘’])_ + Default: _(([a-z][[:alnum:]-]+:(/{1,3}|[a-z0-9%])|www[:digit:]{0,3}[.])([^[:space:](){}<>]+|\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))\*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))\*\])+(\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))\*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))\*\]|[^]\[[:space:]`!(){};:'".,<>?«»“”‘’]))_ # SECTION: regex @@ -817,7 +819,12 @@ regex-copy=[foo] Control+Mod1+Shift+q *regex* Regular expression to use when matching text. The format is - "POSIX-Extended Regular Expressions". Default: _not set_. + "POSIX-Extended Regular Expressions". Note that the first marked + subexpression is used a the URL. In other words, if you want the + whole regex matćh to be used as an URL, surround all of it with + parenthesis: *(regex-pattern)*. + + Default: _not set_. # SECTION: cursor |
