@@ -60,7 +60,13 @@ lua_patterns.tips = {
6060 }, " \n " );
6161 end ,
6262
63- character_set = " Matches characters from a set of matches." ,
63+ character_set = function (_ , item )
64+ if string.match (item .text , " ^%[%^" ) then
65+ return " Matches characters that aren't part of this set." ;
66+ else
67+ return " Matches characters that are part of this set." ;
68+ end
69+ end ,
6470 -- character_set_content = "Set of matches.",
6571 capture_group = " A pattern group to be used for various string operations." ,
6672 character_range = " Matches character within the given range." ,
@@ -89,9 +95,9 @@ lua_patterns.tips = {
8995 elseif txt == " %P" then
9096 table.insert (_l , ' "%P" matches anything that\' s not a punctuation symbol. It\' s equivalent would be: [^a-z].' );
9197 elseif txt == " %s" then
92- table.insert (_l , ' "%p " matches all whitespace characters. It\' s equivalent would be: [ \\ t\\ n\\ r].' );
98+ table.insert (_l , ' "%s " matches all whitespace characters. It\' s equivalent would be: [ \\ t\\ n\\ r].' );
9399 elseif txt == " %S" then
94- table.insert (_l , ' "%P " matches anything that\' s not a punctuation symbol . It\' s equivalent would be: [^ \\ t\\ n\\ r].' );
100+ table.insert (_l , ' "%S " matches anything that\' s not a whitespace character . It\' s equivalent would be: [^ \\ t\\ n\\ r].' );
95101 elseif txt == " %u" then
96102 table.insert (_l , ' "%u" matches all uppercase letters. It\' s equivalent would be: [A-Z].' );
97103 elseif txt == " %U" then
@@ -105,9 +111,9 @@ lua_patterns.tips = {
105111 elseif txt == " %X" then
106112 table.insert (_l , ' "%X" matches anything that\' s not an hexadecimal character. It\' s equivalent would be: [^a-fA-F0-9].' );
107113 elseif txt == " %z" then
108- table.insert (_l , ' "%x" matches the null byte . It\' s equivalent would be: [\\ 0].' );
114+ table.insert (_l , ' "%x" matches the null character . It\' s equivalent would be: [\\ 0].' );
109115 elseif txt == " %Z" then
110- table.insert (_l , ' "%Z" matches anything that\' s not a null byte . It\' s equivalent would be: [^\\ 0].' );
116+ table.insert (_l , ' "%Z" matches anything that\' s not a null character . It\' s equivalent would be: [^\\ 0].' );
111117 else
112118 table.remove (_l , 2 );
113119 end
0 commit comments