diff options
author | nicm <nicm> | 2019-06-13 19:46:00 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-06-13 19:46:00 +0000 |
commit | 3e72e98e3bdf3e814d6d20060247bb5f5dc859bb (patch) | |
tree | 8610823f2b11740c8079b86875bda970f901668a /tmux.1 | |
parent | 7e6a26cc9d857ffc53fdb2395aa5413ff1865f9e (diff) | |
download | rtmux-3e72e98e3bdf3e814d6d20060247bb5f5dc859bb.tar.gz rtmux-3e72e98e3bdf3e814d6d20060247bb5f5dc859bb.tar.bz2 rtmux-3e72e98e3bdf3e814d6d20060247bb5f5dc859bb.zip |
Add regular expression support for the format search, match and
substitute modifiers.
Diffstat (limited to 'tmux.1')
-rw-r--r-- | tmux.1 | 46 |
1 files changed, 37 insertions, 9 deletions
@@ -4012,25 +4012,45 @@ if running on .Ql myhost , otherwise by .Ql 0 . -An -.Ql m -specifies an -.Xr fnmatch 3 -comparison where the first argument is the pattern and the second the string to -compare, for example -.Ql #{m:*foo*,#{host}} . .Ql || and .Ql && evaluate to true if either or both of two comma-separated alternatives are true, for example .Ql #{||:#{pane_in_mode},#{alternate_on}} . +.Pp +An +.Ql m +specifies an +.Xr fnmatch 3 +or regular expression comparison. +The first argument is the pattern and the second the string to compare. +An optional third argument specifies flags: +.Ql r +means the pattern is a regular expression instead of the default +.Xr fnmatch 3 +pattern, and +.Ql i +means to ignore case. +For example: +.Ql #{m:*foo*,#{host}} +or +.Ql #{m/ri:^A,MYVAR} . A .Ql C performs a search for an .Xr fnmatch 3 -pattern in the pane content and evaluates to zero if not found, or a line -number if found. +pattern or regular expression in the pane content and evaluates to zero if not +found, or a line number if found. +Like +.Ql m , +a +.Ql r +flag means search for a regular expression and +.Ql i +ignores case. +For example: +.Ql #{C/r:^Start} .Pp A limit may be placed on the length of the resultant string by prefixing it by an @@ -4103,6 +4123,14 @@ will substitute with .Ql bar throughout. +The first argument may be an extended regular expression and a final argument may be +.Ql i +to ignore case, for example +.Ql s/a(.)/\1x/i: +would change +.Ql abABab +into +.Ql bxBxbx . .Pp In addition, the first line of a shell command's output may be inserted using .Ql #() . |