ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/matcher
(Generate patch)

Comparing rxvt-unicode/src/perl/matcher (file contents):
Revision 1.38 by sf-exg, Sun Nov 21 17:08:57 2021 UTC vs.
Revision 1.39 by root, Sun Nov 21 19:33:32 2021 UTC

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
93Urxvt stores all text as unicode, in a special encoding that uses
94one character/code point per column. For various reasons, the regular
95expressions are matched directly against this encoding, which means there are a few things
96you need to keep in mind:
97
98=over
99
100=item X resources/command line arguments are locale-encoded
101
102The regexes taken from the command line or resources will be converted
103from locale encoding to unicode. This can change the number of code points
104per character.
105
106=item Wide characters are column-padded with C<$urxvt::NOCHAR>
107
108Wide characters (such as kanji and sometimes tabs) are padded with
109a special character value (C<$urxvt::NOCHAR>). That means that
110constructs such as C<\w> or C<.> will only match part of a character, as
111C<$urxvt::NOCHAR> is not matched by C<\w> and both only match the first
112"column" of a wide character.
113
114That means you have to incorporate C<$urxvt::NOCHAR> into parts of regexes
115that may match wide characters. For example, to match C<\w+> you might
116want 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
93my $url = 123my $url =
94 qr{ 124 qr{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines