aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-02-04 09:10:10 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-02-05 12:35:17 +0000
commitb1f16c84e0be8d3074139f0be56e0852acceaef3 (patch)
treeb86e693f082ad1e0618be4356c646ea18e1a3cf7 /doc
parentspawn template variables are on the form ${}, not {} (diff)
doc: improve regex example
Diffstat (limited to 'doc')
-rw-r--r--doc/foot.ini.5.scd19
1 files changed, 10 insertions, 9 deletions
diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd
index 89984ef5..68216fcd 100644
--- a/doc/foot.ini.5.scd
+++ b/doc/foot.ini.5.scd
@@ -801,16 +801,17 @@ Similar to the 'url' mode, but with custom defined regular expressions
To use a custom defined regular expression, you also need to add a key
binding for it. This is done in the *key-binding* section, see below
-for details. In short, you need to:
+for details. For example, a regex to detect hash digests (e.g. git
+commit hashes) could look like:
```
-[regex:foo]
-regex=foo(bar)?
+[regex:hashes]
+regex=([a-fA-f0-9]{7,128})
launch=path-to-script-or-application ${match}
[key-bindings]
-regex-launch=[foo] Control+Shift+q
-regex-copy=[foo] Control+Mod1+Shift+q
+regex-launch=[hashes] Control+Shift+q
+regex-copy=[hashes] Control+Mod1+Shift+q
```
*launch*
@@ -1278,13 +1279,13 @@ e.g. *search-start=none*.
binding:
```
- [regex:foo]
- regex=foo(bar)?
+ [regex:hashes]
+ regex=([a-fA-f0-9]{7,128})
launch=path-to-script-or-application ${match}
[key-bindings]
- regex-launch=[foo] Control+Shift+q
- regex-copy=[foo] Control+Mod1+Shift+q
+ regex-launch=[hashes] Control+Shift+q
+ regex-copy=[hashes] Control+Mod1+Shift+q
```
Default: _none_.