… | |
… | |
85 | URxvt.keysym.M-Delete: matcher:list |
85 | URxvt.keysym.M-Delete: matcher:list |
86 | URxvt.matcher.button: 1 |
86 | URxvt.matcher.button: 1 |
87 | URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] |
87 | URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] |
88 | URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) |
88 | URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) |
89 | URxvt.matcher.launcher.2: gvim +$2 $1 |
89 | URxvt.matcher.launcher.2: gvim +$2 $1 |
|
|
90 | |
|
|
91 | =head2 Regex encoding/wide character matching |
|
|
92 | |
|
|
93 | Urxvt stores all text as unicode, in a special encoding that uses |
|
|
94 | one character/code point per column. For various reasons, the regular |
|
|
95 | expressions are matched directly against this encoding, which means there are a few things |
|
|
96 | you need to keep in mind: |
|
|
97 | |
|
|
98 | =over |
|
|
99 | |
|
|
100 | =item X resources/command line arguments are locale-encoded |
|
|
101 | |
|
|
102 | The regexes taken from the command line or resources will be converted |
|
|
103 | from locale encoding to unicode. This can change the number of code points |
|
|
104 | per character. |
|
|
105 | |
|
|
106 | =item Wide characters are column-padded with C<$urxvt::NOCHAR> |
|
|
107 | |
|
|
108 | Wide characters (such as kanji and sometimes tabs) are padded with |
|
|
109 | a special character value (C<$urxvt::NOCHAR>). That means that |
|
|
110 | constructs such as C<\w> or C<.> will only match part of a character, as |
|
|
111 | C<$urxvt::NOCHAR> is not matched by C<\w> and both only match the first |
|
|
112 | "column" of a wide character. |
|
|
113 | |
|
|
114 | That means you have to incorporate C<$urxvt::NOCHAR> into parts of regexes |
|
|
115 | that may match wide characters. For example, to match C<\w+> you might |
|
|
116 | want to use C<[\w$urxvt::NOCHAR]+> instead, and to match a single character |
|
|
117 | (C<.>) you might want to use C<.$urxvt::NOCHAR*> instead. |
|
|
118 | |
|
|
119 | =back |
90 | |
120 | |
91 | =cut |
121 | =cut |
92 | |
122 | |
93 | my $url = |
123 | my $url = |
94 | qr{ |
124 | qr{ |