In many of the examples above you see
% being used in the patterns, this is because what you enter is really a
"pattern", not just a plain search string.
In Lua (the programming language of FlexHub) patterns works similar to RegExp, but not identical. To write efficient patterns for FlexHub it is good if you understand the difference.
Here is a short explanation of Lua patterns from the Lua 5.1 manual:
(for a more complete explanation there is the Lua manual
here, and there is also the online version of the book
"Programming in Lua")
Character Class:A character class is used to represent a set of characters. The following combinations are allowed in describing a character class:
- x: (where x is not one of the magic characters ^$()%.[]*+-?) represents the character x itself.
- .: (a dot) represents all characters.
- %a: represents all letters.
- %c: represents all control characters.
- %d: represents all digits.
- %l: represents all lowercase letters.
- %p: represents all punctuation characters.
- %s: represents all space characters.
- %u: represents all uppercase letters.
- %w: represents all alphanumeric characters.
- %x: represents all hexadecimal digits.
- %z: represents the character with representation 0.
- %x: (where x is any non-alphanumeric character) represents the character x. This is the standard way to escape the magic characters. Any punctuation character (even the non magic) can be preceded by a '%' when used to represent itself in a pattern.
For all classes represented by single letters (%a, %c, etc.), the corresponding uppercase letter represents the complement(opposite) of the class. For instance, %S represents all non-space characters.
The definitions of letter, space, and other character groups depend on the current locale. In particular, the class [a-z] may not be equivalent to %l.
Pattern Item:A pattern item can bea single character class, which matches any single character in the class;
a single character class followed by '*', which matches 0 or more repetitions of characters in the class. These repetition items will always match the longest possible sequence;
a single character class followed by '+', which matches 1 or more repetitions of characters in the class. These repetition items will always match the longest possible sequence;
a single character class followed by '-', which also matches 0 or more repetitions of characters in the class. Unlike '*', these repetition items will always match the shortest possible sequence;
a single character class followed by '?', which matches 0 or 1 occurrence of a character in the class;
Pattern:A pattern is a sequence of pattern items. A '^' at the beginning of a pattern anchors the match at the beginning of the subject string. A '$' at the end of a pattern anchors the match at the end of the subject string. At other positions, '^' and '$' have no special meaning and represent themselves.
A pattern cannot contain embedded zeros. Use %z instead.
Some more examples:If you want to match a no-ip address (which contains the magic character
- ) you would have to place a % infront of the - like this "
somedomain.no%-ip.com" , the dots are also magical, but as they match 'any character' in this case it doesnt really matter.
If you want to match any nick with tags you could use a pattern like this "
^%[.+%].+". This would match anything that starts with [ has at least one character and then a ] and then atleast one more character, like [SWE]en_dator

.
I hope all this made some sence, and that it wasnt too difficult to understand.
/en_dator