FlexHub Forum

Feature showroom - Patterns

Offline FlipFlop™

  • FlexHub Developer
  • *****
  • 505
Feature showroom - Patterns
« on: August 15, 2010, 10:35:40 »
One of the most powerful tools in FlexHub is the pattern-checker. With the pattern-checker it's possible to generate an action on a wide variety of patterns.

Here's how a pattern can be added:

   !addpattern <type> "<pattern>" [-p<profilelevel>] [-a<actions>] [-r<replace> "<text>"]

      <type>      What to check:
         MC = Mainchat
         PM = Personal messages
         RE = Reports
         SE = Searches
         SR = Searchresults

         NI = Nickname
         DE = Description
         EM = Email
         VE = Clientversion
         SS = Sharesize

      "<pattern>"      A Lua pattern for matching the string

      [-p<profilelevel>]   The maximum profilelevel to check, a number in the range from -1 (User) to 10 (Hubowner)

      [-a<actions>]      A number defining what action to take:
         0   Allow (can only be used in combination with replace)
         1   Ignore
         2   Notify user
         4   Warn user
         8   Mute user
         16   Disconnect user
         32   Kick user
         64   Ban user
         128   Redirect user (uses the redirect address from: !set rd_flood)

         One of the values above (except 0) can be combined with one or more of the following:

         256   Notify Opchat
         512   Lock Mainchat (use with caution)

      [-r<number> "<text>"]      What to replace <number> followed by the replacing "<text>":
         1   Replace match
         2   Replace entire message

More types can be added later: SU for supportstring, IP for ip patterns, or DN for dns-patterns for example.
The pattern supports RegExp so it's possible to create a quite smart detection.
« Last Edit: January 16, 2012, 22:55:38 by en_dator »
Check the new FlexHubList!           Add awesome statistics like this for your hub!

This post is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.

Offline LadyStardust

  • *****
  • 257
  • aka Puma
Re: Feature showroom - Patterns
« Reply #1 on: August 15, 2010, 10:46:59 »
Examples:

!addpattern SE "gummybear" -p-1 -a32 (Not registered users who will search for a word GummyBear will be kicked from a hub)

!addpattern SS "1111111" -p-1 -a64 (User matching forbidden share will be banned from a hub)

!addpattern NI "^hub.*" -p-1 -a128 (User whose nickname starts with "hub" will get redirected)

!addpattern MC ".*google.*" -p-1 -a0 -r2 "I don't know how to use google.com" (All sentences that will contain a word "google" will be replaced by "I don't know how to use google.com")

!addpattern TA ".*0.668.*" -p-1 -a64 (User who will login with a client version: 0.668 will get banned from a hub)


Default patterns in Flexhub at the moment are:

Showing patterns for: NI nickname (priority ordered)

       Profile        Actions        Pattern                                Actions

       ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
   1   32   "%S+://"                           Kick
   1   32   "%d+%.%d+%.%d+%.%d+"               Kick
   1   32   "[Ww][Ww][Ww]%."                   Kick


Showing patterns for: MC mainchat message (priority ordered)

       Profile        Actions        Pattern                                Actions

       ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
   1   32   "%S+://"                           Kick
   1   32   "%d+%.%d+%.%d+%.%d+"               Kick
   1   32   "[Ww][Ww][Ww]%."                   Kick

Showing patterns for: PM private message (priority ordered)

       Profile        Actions        Pattern                                Actions

       ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
   1   32   "%S+://"                           Kick
   1   32   "%d+%.%d+%.%d+%.%d+"               Kick
   1   32   "[Ww][Ww][Ww]%."                   Kick
« Last Edit: August 13, 2011, 13:00:13 by LadyStardust »
Best regards,
LS

Offline LadyStardust

  • *****
  • 257
  • aka Puma
Re: Feature showroom - Patterns
« Reply #2 on: August 13, 2011, 12:55:27 »
Some more examples and tips:

1. Some users are using commands in bad way, like "regme" instead of "!regme password" or "fav" istead of "/fav"
Hub can react on those and give a user a tip how proper command looks like:

!addpattern MC "regme" -p-1 -a2 -r2"Please type !regme <your password> to register in our hub"
!addpattern MC "fav" -p-1 -a2 -r2"Please type /fav to add hub to your Favorite Hubs"

2. If you would like to ban people for searching for files that are not allowed in your hub, you can do that too:

[12:34:04] <`°º¤MotherNature¤º°`> *** !showpattern SE
[12:34:04] <`°º¤MotherNature¤º°`>

   Showing patterns for: SE search (priority ordered)

   Profile   Actions   Pattern            Actions
   ________________________________________________________________________________

   2   128   "incest"                           Redirect
   2   128   "r@y"                              Redirect
   2   128   "rape"                             Redirect

3. Also if you are fed up with constant reports to your opchat and you dont want to disable command !report itself, you can add pattern for reporting too:

!addpattern RE "ophub" -p-1 -a32

4. Also to prevent some bots entering your hub, you can add pattern on nicks/prefixes:

[12:48:24] <`°º¤MotherNature¤º°`> *** !showpattern NI
[12:48:24] <`°º¤MotherNature¤º°`>

   Showing patterns for: NI nickname (priority ordered)

   Profile   Actions   Pattern            Actions
   ________________________________________________________________________________

   -1   1   "%[RO%]%[CT%]%[RDS%]"              Ignore       Replace line with:    Bots are not allowed

5. Description also can be banned:

!addpattern DE "mynick" -p-1 -a32 -r1"Your computer is infected with a virus. Please remove it"

Using -r we can give a reason for kicking the user. User when disconnected will get a message:
[12:51:55] <`°º¤MagicParrot¤º°`> You are kicked by <`°º¤MagicParrot¤º°`> because: Your computer is infected with virus. Please remove it.
Best regards,
LS

Re: Feature showroom - Patterns
« Reply #3 on: January 16, 2012, 22:55:00 »
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 be

a 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


Offline sergius_s

  • *
  • 236
  • Be yourself...
Re: Feature showroom - Patterns
« Reply #4 on: June 28, 2013, 11:00:59 »
Pattern is really a very powerful tool in the FlexHub.
I have successfully set up the anti-spam using Patterns NI, DE, MC, PM and i completely got rid of the foul language in main chat(pattern MC).
It is more convenient and easier than writing scripts(eg PtokaX).
Thank you for what you are doing good and reliable software.

I'll show patterns that can be used for Russian hubs (anti-obscene lexicon, anti-spam, etc):
Code: [Select]
Showing patterns for: MC mainchat message (priority ordered)

Profile Actions Pattern Actions
________________________________________________________________________________

-1 2 "regme"                         Notify Replace line with: Please type !regme <your password> to register in our hub / Для регистрации ведите !regme пароль
-1 2 "^ !regme"                       Notify Replace line with: Please type !regme <your password> to register in our hub / Для регистрации ведите !regme пароль
1 2 "^+fav$"                         Notify Replace line with: Please type /fav to add hub to your Favorite Hubs  /  Напишите /fav чтобы добавить хаб в избранные
1 2 "^ /fav$"                       Notify Replace line with: Please type /fav to add hub to your Favorite Hubs  /  Напишите /fav чтобы добавить хаб в избранные
1 2 "^fav$"                         Notify Replace line with: Please type /fav to add hub to your Favorite Hubs  /  Напишите /fav чтобы добавить хаб в избранные
1 2 "^!fav$"                         Notify Replace line with: Please type /fav to add hub to your Favorite Hubs  /  Напишите /fav чтобы добавить хаб в избранные
4 0 "dchub://"                       Replace line with: (spam)
5 0 "[Дд]+[АаОоAaOo]+[ХхXx]+[УуYy]+[ЯяЙй]+" Replace match with: #
5 0 "[EeЕеЁё][Бб]OoОоАаAa][TТт]"     Replace match with: #
5 0 "^[ОоАаOoAa]+[ТтT]+[ЪъЬь]*[ЁёЕеИиEe]+[Бб]+" Replace match with: #
5 0 "[%s%p ][Пп]+[ОоOo]+[ХхXx]+$"   Replace match with: #
5 0 "^[УуYy]*[ЁёЕеEe]+[Бб]+"         Replace match with: #
5 0 "[Зз3]+[АаAa]+[ЕеЯяEe]+[Бб]+[ИиУуYy]+[СсCc]+" Replace match with: #
5 0 "[%s%p ][Пп]+[ОоOoАаAa]+[Дд]*[ЪъЬь]*[ЕеЁёEe]+[Бб]+" Replace match with: #
5 0 "[ЬьЪъ]+[ЕеEe]+[Бб]+[АаAaУуYy]+[НнHЙйЛл]+" Replace match with: #
5 0 "^[Пп]+[Ии]+[Дд]+[ЕеEeОоOoАаAa]+[РрPp]+" Replace match with: #
5 0 "[ЕеЁёEe]+[Бб]+[НнH]+[УуYy]+[ТтT]+[Ыы]+[ЙйЕеМмХхEeMXx]+" Replace match with: #
5 0 "^[БбМмM]+[Лл]+[Яя]+[ТтДдЦцT]*$" Replace match with: #
5 0 "^[Чч]+[МмM]+[ОоOo]+[Шш]"       Replace match with: #
5 0 "[%s%p ][ЕеEe]+[Бб]+[Лл]+[ОоАаOoAa]+" Replace match with: #
5 0 "[Зз3]+[АаAa]+[ЕеЁёEeИи]+[Бб]+[КкОоKOo]+[ИиКкK]+" Replace match with: #
5 0 "[%s%p ][Пп]+[ОоOo]+[ХхXx]+[%s%p ]" Replace match with: #
5 0 "[%s%p ][МмM]+[РрPp]+[АаAa]+[Зз3СсCc]+[ЬьИи]+" Replace match with: #
5 0 "[Мм][Рр][Аа][Зз]"               Replace match with: #
5 0 "[ЕеЁёEe]+[Бб]+[АаAa]+[НнH]+[Ии]+[СсCc]+[Ьь]*" Replace match with: #
5 0 "[Пп]+[ОоOo]+[ХхXx]+[ЕеEe]+[РрPp]+" Replace match with: #
1 0 "%d+%.%d+%.%d+%.%d+"             Replace match with: (spam)
5 0 "[Пп]+[ОоOo]+[ХхXx]+[УуYy]+[Йй]+" Replace match with: #
5 0 "^[Пп]+[ЕеЁёEe]+[РрPp]+[ЕеЁёEeИи]+[ЕеЁёEe]+[БбПп]+" Replace match with: #
5 0 "^[Мм]+[РрPp]+[АаAa]+[Зз3СсCc]+[ЬьИи]+" Replace match with: #
5 0 "^[ХхXx]+[УуYy]+[ЙйИиЕеEeЁёЭэЯяЮю]+$" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[Йй]+[НнH]+[ЯяИиЮюЕеЁёEe]+" Replace match with: #
5 0 "^[ХхXx]+[УуYy]+[Лл]+[ИиЬьЕеEe][%s%p ]" Replace match with: #
5 0 "[Дд][Рр][Оо][Чч]"               Replace match with: #
5 0 "[Хх][Ее][Рр]"                   Replace match with: #
5 0 "[ХхXx]+[УуYy]+[Яя]+%s*[CcCc]+[ЕеEe]+" Replace match with: #
5 0 "[%s%p ][Пп]+[ЕеEe]+[Дд]+[Ии]+[КкKk]+[АаИиУуЕеОо]*[Мм]*$" Replace match with: #
5 0 "[Пп]+[Ии]+[Дд]+[РрPp]+$"       Replace match with: #
5 0 "[%s%p ][Пп]+[ЕеЁёEe]+[РрPp]+[ЕеЁёEeИи]+[ЕеЁёEe]+[БбПп]+" Replace match with: #
5 0 "[Пп]+[РрPp]+[ОоOo]+[ЕеЁёEe]+[Бб]+" Replace match with: #
5 0 "[^Лл][ЕеЁёEe]+[Бб]+[АаAa]*[НнH]+[УуYy]+[ТтT]+[Ьь]*[СсCc]+[ЯяИи]+" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[ЕеЯяИиEe]+[СсCc]+[ОоOo]+[СсCc]+" Replace match with: #
5 0 "[Пп][Рр][Оо][Сс][Тт][Ии][Тт][Уу]" Replace match with: #
5 0 "[Хх][Уу][Йй]"                   Replace match with: #
5 0 "[Гг][Аа][Нн][Дд][Оо][Нн]"       Replace match with: #
5 0 "[ХхXx]+[УуYy]+[ЕеЯяEe]+[ТтT]+[АаAa]+" Replace match with: #
5 0 "[ВвB]+[АаAa]+[Фф]+[Лл]+[ЁёЕеEe]+[РрPp]+" Replace match with: #
5 0 "[Пп]+[ИиЕеEe]*[Зз3СсCc]+[Дд]+[Юю]+[КкKk]+" Replace match with: #
5 0 "[%s%p ][БбМмM]+[Лл]+[Яя]+[ТтДдЦцT]*[%s%p ]" Replace match with: #
5 0 "[ВвB]+[Ыы]+[ЕеEe]+[Бб]+[УуYy]+" Replace match with: #
5 0 "[Пп]+[ИиЕеEe]*[Зз3СсCc]+[Дд]+[УуЕеИиЁёAaYyEeAaOoАаОо0ЯяЫы]+" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[ЯяЕеEe]+[Пп]+[Лл]+[ЁёЕеEe]+[ТтT]+" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[ЕеEe]+[Юю]+"     Replace match with: #
5 0 "^[ЕеEe]+[Бб]+[Лл]+[ОоАаOoAa]+" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[ЕеЯяИи]+[ТтT]+[ЕеEe]+[НнH]+" Replace match with: #
5 0 "[ЕеEe]+[Бб]+[АаAa]+[НнH]+[УуYy]+[Цц]*[АаAa]+" Replace match with: #
5 0 "^[Пп]*[РрPp]*[ОоOo]*[Бб]+[Лл]+[Яя]+[ДдТтT]+[ЬьИи]+" Replace match with: #
5 0 "[ОоАаOoAa]+[ХхXx]+[УуYy]+[ЕеEe]+[НнЛлТтВвHT]+" Replace match with: #
5 0 "^[БбМмM]+[Лл]+[Яя]+[ТтДдЦцT]*[%s%p ]" Replace match with: #
5 0 "[ЕеЁёEe]+[Бб]+[АаAa]+[НнH]+[ЫыАаУуОоAaYyOo]+[ЙйЯяЕеЮюEe]+" Replace match with: #
1 0 "[A-Za-z0-9]+%.nu"               Replace match with: (spam)
5 0 "[Дд]+[ОоOo]+[Лл]+[Бб]+[АаОоAaOo]+[ЁёЕеEe]+[БбПп]+" Replace match with: #
5 0 "[ЕеEe]+[Бб]+[АаAa]+[НнH]+[УуYy]+[ТтT]+[ЫыАаAa]+[ЙйЯя]+" Replace match with: #
5 0 "[%s%p ][Зз3]+[АаAa]+[Лл]+[УуYy]+[Пп]+[АаОоЫыЕеУуИиAaOoEeYy]+" Replace match with: #
5 0 "^[Пп]+[ОоOo]+[ХхXx]+$"         Replace match with: #
1 0 "[A-Za-z0-9]+%.ru"               Replace match with: (spam)
5 0 "[Пп][Ии][Зз]"                   Replace match with: #
5 0 "[%s%p ][ОоАаOoAa]+[ТтT]+[ЪъЬь]*[ЁёЕеИиEe]+[Бб]+" Replace match with: #
1 0 "%-%s?mine%s?%.%s?nu"           Replace match with: (spam)
5 0 "[Пп]+[РрPp]+[ОоOo]+[ЕеEe]+[Бб]+[АаAa]+[Лл]+" Replace match with: #
5 0 "[%s%p ][НнH]+[АаЕеAaEe]+[ХхXx]+$" Replace match with: #
5 0 "[Пп][Рр][Аа][Сс][Тт][Ии][Тт][Уу]" Replace match with: #
5 0 "[ХхXx]+[ЕеEe]+[РрPp]+[НнH]+[ЯяЮюИиЕеЁёEe]+" Replace match with: #
5 0 "^[ВвB]+[ЫыЬьЪъ]+[ЁёЕеEe]+[Бб]+" Replace match with: #
5 0 "[ЕеEe]+[Бб]+[Лл]+[АаAa]+[НнH]+" Replace match with: #
5 0 "[МмM]+[УуYy]+[Дд]+[АаОоAaOo]+[Зз3]+[ВвB]+[ОоOo]+[НнH]+" Replace match with: #
5 0 "[Пп][Ии][Зз3][Дд][НнH]"         Replace match with: #
5 0 "[Дд]+[АаОоAaOo]+[ЕеИиEe]+[Бб]+[АаAa]+[Лл]+" Replace match with: #
5 0 "[%s%p ][ХхXx]+[УуYy]+[Лл]+[ИиЬьЕеEe][%s%p ]" Replace match with: #
5 0 "[Пп][Ии][СсCc][TТт][АаAa]"     Replace match with: #
5 0 "^[АаAa]+[ХхXx]+[УуYy]+[ЕеEeИи]" Replace match with: #
5 0 "[Хх][Уу][Ёё]"                   Replace match with: #
5 0 "[%s%p ][Bb]+[Ii]+[Tt]+[Cc]+[Hh]+$" Replace match with: #
5 0 "^[Пп]+[ЕеEe]+[Дд]+[Ии]+[КкKk]+[АаИиУуЕеОо]*[Мм]*$" Replace match with: #
5 0 "[Пп]+[ИиЕеEe]+[Дд]+[РрPp]+[Ии]+[Лл]+[АаЫыУуОоЕеAaYyOoEeAa]+" Replace match with: #
5 0 "[РрPp][AaАа][Зз3][Ъъ][ЕеЁёEe][Бб]" Replace match with: #
5 0 "[%s%p ][Ss]+[Uu]+[Cc]+[Kk]+[^Ii]*" Replace match with: #
5 0 "^[Ss]+[Uu]+[Cc]+[Kk]+[^Ii]*"   Replace match with: #
5 0 "^[Cc]+[Oo]+[Cc]+[Kk]+$"         Replace match with: #
5 0 "[Хх][Уу][Яя]"                   Replace match with: #
5 0 "^[ХхXx]+[ЕеEe]+[РрPp]+[%s%p ]" Replace match with: #
5 0 "[%s%p ][НнH]+[АаЕеAaEe]+[ХхXx]+[%s%p ]" Replace match with: #
5 0 "^[Cc]+[Oo]+[Cc]+[Kk]+[%s%p ]"   Replace match with: #
5 0 "[%s%p ][ХхXx]+[ЕеEe]+[РрPp]+$" Replace match with: #
5 0 "[Хх][Уу][Ии]"                   Replace match with: #
5 0 "[Пп]+[ИиЕеEe]*[Зз3СсCc]+[Дд]+[АаОоAaOo]+[Бб]+[ОоOo]+[Лл]+" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[ЕеEe]+[НнH]+[Ьь]+" Replace match with: #
5 0 "[%s%p ][Ff]+[Uu]+[Cc]+[Kk]+"   Replace match with: #
5 0 "[Вв][ЪъЬь][EeЕе][Бб]"           Replace match with: #
5 0 "^[Чч]+[МмM]+[ОоOo]+[%s%p ]"     Replace match with: #
5 0 "[Чч][Мм][Оо]"                   Replace match with: #
5 0 "[Жж]+[ОоOo]+[Пп]+[Ии]+[Щщ]+"   Replace match with: #
5 0 "[%s%p ][ХхXx]+[УуYy]+[ЁёЕеEe]+[ВвB]+$" Replace match with: #
5 0 "^[Bb]+[Ii]+[Tt]+[Cc]+[Hh]+[%s%p ]" Replace match with: #
5 0 "[%s%p ][ВвB]*[ХхXx]+[УуYy]+[ЙйИиЕеEeЁёЭэЯяЮю]+" Replace match with: #
1 0 "%S+://"                         Replace line with: (spam)
5 0 "[%s%p ][Bb]+[Ii]+[Tt]+[Cc]+[Hh]+[%s%p ]" Replace match with: #
5 0 "[%s%p ][Пп]+[Ии]+[Дд]+[ЕеEeОоOoАаAa]+[РрPp]+" Replace match with: #
5 0 "[Сс][Уу][Кк][Аа]"               Replace match with: #
5 0 "[%s%p ][ВвB]+[ЫыЬьЪъ]+[ЁёЕеEe]+[Бб]+" Replace match with: #
5 0 "[Ff][Uu][Cc][Kk]"               Replace match with: #
5 0 "^[Пп]+[ЕеEe]+[Дд]+[Ии]+[КкKk]+[АаИиУуЕеОо]*[Мм]*[%s%p ]" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[ЙйИи]+[ЛлЩщ]+[АаОоЕеAaOoEe]+" Replace match with: #
5 0 "^[ЕеЁёИиEe]+[Бб]+[УуИиАаЕеЁёYyAaEeЛлЫы]+" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[Яя]+[РрЧч]+[Ии]+[ТтЛлT]+" Replace match with: #
5 0 "[Зз3]+[АаAa]+[ХхXx]+[УуYy]+[ЙйЯя]+" Replace match with: #
5 0 "[Бб]+[Лл]+[Яя]+[Дд]+"           Replace match with: #
5 0 "[Бб][Лл][Яя]"                   Replace match with: #
5 0 "[%s%p ][Чч]+[МмM]+[ОоOo]+$"     Replace match with: #
5 0 "[%s%p ][Ии]+[Зз3]+[ЬьЪъ]*[ЕеЁёEe]+[Бб]+" Replace match with: #
5 0 "^[Ии]+[Зз3]+[ЬьЪъ]*[ЕеЁёEe]+[Бб]+" Replace match with: #
5 0 "^[Пп]+[ОоOoАаAa]+[Дд]*[ЪъЬь]*[ЕеЁёEe]+[Бб]+" Replace match with: #
5 0 "[Бб]+[Лл]+[ЯяЕеEe]+[Дд]+[УуYy]+[НнH]+" Replace match with: #
5 0 "[УуYy]+[ЕеЁёEe]+[Бб]+[АаAaОоOo]+[НнHКкKk]+" Replace match with: #
5 0 "[ЕеЁёEe]+[Бб]+[НнH]+[УуYy]+[Цц]*[АаAa]+" Replace match with: #
5 0 "^[Bb]+[Ii]+[Tt]+[Cc]+[Hh]+$"   Replace match with: #
1 0 "%-%s?hub%s?%.%s?org"           Replace match with: (spam)
5 0 "[Пп]+[ИиЕеEe]*[Зз3СсCc]+[Дд]+[ОоУуOoYy]+[ЙйНнСсHCc]+" Replace match with: #
5 0 "[Пп]+[ОоOo]+[ХхXx]+[УуYy]+[ИиЙй]+" Replace match with: #
5 0 "[Пп]+[ОоАаOoAa]+[ЯяЕеИиEe]+[Бб]+[АаУуИиAaYy]+[ТтT]+" Replace match with: #
5 0 "[НнH]+[АаЕеИиAaEe]+%s*[ХхXx]+[УуYy]+[ЙйЯя]+" Replace match with: #
5 0 "[%s%p ][ХхXx]+[ЕеEe]+[РрPp]+[%s%p ]" Replace match with: #
5 0 "[Пп]+[Ии]+[Дд]+[РрPp]+[%s%p ]" Replace match with: #
5 0 "[МмM]+[АаОоAaOo]+[Зз3]+[Гг]+[АаОоAaOo]+[ЁёЕеEe]+[БбПп]+" Replace match with: #
5 0 "[ВвB]+[Ыы]+[ТтT]+[РрPp]+[АаAa]+[ХхXx]+" Replace match with: #
5 0 "[%s%p ]+[Бб]+[Лл]+[Яя]+[ДдТтT]+[ЬьИи]+" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[Яя]+[КкKk]+"     Replace match with: #
5 0 "^[НнH]+[АаЕеAaEe]+[ХхXx]+[%s%p ]" Replace match with: #
5 0 "[НнH]+[ИиЕеEe]+[ХхXx]+[УуYy]+[ЁёЕеEe]+[ВвB]+[ОоЫыАаOoAa]+" Replace match with: #
5 0 "[%s%p ][Чч]+[МмM]+[ОоOo]+[Шш]" Replace match with: #
5 0 "^[Чч]+[МмM]+[ОоOo]+$"           Replace match with: #
5 0 "[%s%p ][Чч]+[МмM]+[ОоOo]+[%s%p ]" Replace match with: #
1 0 "no%-ip%."                       Replace match with: (spam)
5 0 "[РрPp]+[АаAa]+[Зз3]+[ЪъЬь]*[ЕеИиEe]+[Бб]+[АаAa]+[ТтЛлT]+" Replace match with: #
5 0 "[^Лл][ЕеЁёEe]+[Бб]+[НнH]+[ИиУуYy]+[СсCc]+[Ьь]+" Replace match with: #
5 0 "[СсCc]+[РрPp]+[АаAa]+[НнЛлТтHT]+[Ьь]+" Replace match with: #
5 0 "[Зз3]+[АаAa]+[ТтT]+[РрPp]+[АаAa]+[ХхXx]+" Replace match with: #
5 0 "[Пп]+[РрPp]+[АаОоAaOo]+[Шш]+[МмM]+[АаОоAaOo]+[НнH]+[Дд]+" Replace match with: #
5 0 "[ХхXx]+[ЕеEe]+[РрPp]+[АаAa]+[Чч]+[Ии]+[ТтT]+" Replace match with: #
5 0 "[ЕеЁёEe]+[Бб]+[УуYy]+[Чч4]+"   Replace match with: #
5 0 "[СсCc]+[УуYy]+[Чч]+[АаAa]+[РрPp]+[АаЫыУуОоЕеAaYyOoEe]+" Replace match with: #
5 0 "^[Пп]+[ОоOo]+[ХхXx]+[%s%p ]"   Replace match with: #
5 0 "^[Шш][Лл][Юю]"                   Replace match with: #
5 0 "[НнH]+[ЕеИиEe]+%s*[ЕеИиEe]+[Бб]+[ЁёЕеEe]+[ТтT]+" Replace match with: #
1 0 "%-%s?us%s?%.%s?to"             Replace match with: (spam)
5 0 "[Пп]+[ОоАаOoAa]+[ЯяЕеИиEe]+[Бб]+[ЕеEe]+[НнH]+" Replace match with: #
5 0 "^[ХхXx]+[УуYy]+[ЁёЕеEe]+[ВвB]+[%s%p ]" Replace match with: #
5 0 "[Хх][Уу][Ее]"                   Replace match with: #
5 0 "[ОоАаOoAa]+[ХхXx]+[УуYy]+[Ии]+[ТтT]+[ЕеИиEe]+[Лл]+" Replace match with: #
5 0 "[ВвB]+[Ыы]+[ЕеЯяEe]+[Бб]+[ЛлКкK]+[Ии]+" Replace match with: #
5 0 "[EeЕеЁё][Бб][АаAaЫы]"           Replace match with: #
5 0 "[Зз][Аа][Дд][Рр][Оо]"           Replace match with: #
5 0 "[%s%p ][НнHЗз3]+[АаAa]+[ЕеЁёEe]+[Бб]+" Replace match with: #
5 0 "[%s%p ][ХхXx]+[УуYy]+[Лл]+[ИиЬьЕеEe]$" Replace match with: #
5 0 "[Жж]+[ОоOo]+[Пп]+[АаУуЕеОоAaYyEeOo]+" Replace match with: #
1 0 "[A-Za-z0-9]+%.biz"             Replace match with: (spam)
5 0 "[%s%p ][БбМмM]+[Лл]+[Яя]+[ТтДдЦцT]*$" Replace match with: #
5 0 "[УуYy]+[ЁёЕеEe]+[Бб]+[ОоКкOoK]+[КкИиK]+" Replace match with: #
5 0 "[Ёё][Бб]"                       Replace match with: #
5 0 "[УуYy]+[ЁёЕеEe]+[Бб]+[Ии]+[Щщ]+[ЕеEe]+" Replace match with: #
5 0 "[ЕеEe]+[Бб]+[УуАаYyAa]+[ТтT]+[Ьь]*[СсCc]+[Яя]+" Replace match with: #
5 0 "[%s%p ][Cc]+[Oo]+[Cc]+[Kk]+[%s%p ]" Replace match with: #
5 0 "^[НнH]+[АаЕеAaEe]+[ХхXx]+$"     Replace match with: #
1 0 "%a+[.]%a+[.]%a+"               Replace match with: (spam)
5 0 "^[НнHЗз3]+[АаAa]+[ЕеЁёEe]+[Бб]+" Replace match with: #
5 0 "^[Ff]+[Uu]+[Cc]+[Kk]+"         Replace match with: #
5 0 "[Дд][Рр][Аа][Чч]"               Replace match with: #
5 0 "[%s%p ][ЕеЁёEe]+[Бб]+[НнH]+[ИиУуYy]+" Replace match with: #
5 0 "^[ЕеЁёEe]+[Бб]+[НнH]+[ИиУуYy]+" Replace match with: #
5 0 "^[Зз3]+[АаAa]+[Лл]+[УуYy]+[Пп]+[АаОоЫыЕеУуИиAaOoEeYy]+" Replace match with: #
1 0 "[A-Za-z0-9]+%.com"             Replace match with: (spam)
5 0 "[НнHЗз3]+[АаAa]+[ЕеЁёEe]+[Бб]+[Ыы]+" Replace match with: #
5 0 "[Шш]+[Лл]+[Юю]+[ХхXx]+[АаИиУуОоAaYyOo]+[Йй]*" Replace match with: #
5 0 "[%s%p ][ЕеЁёИиEe]+[Бб]+[УуИиАаЕеЁёYyAaEeЛлЫы]+[^Цц]" Replace match with: #
5 0 "^[ВвB]*[ХхXx]+[УуYy]+[ЙйИиЕеEeЁёЭэЯяЮю]+" Replace match with: #
5 0 "[МмM]+[УуYy]+[Дд]+[АаAa]+[КкK]+" Replace match with: #
5 0 "[%s%p ][ХхXx]+[УуYy]+[ЁёЕеEe]+[ВвB]+[%s%p ]" Replace match with: #
1 0 "[A-Za-z0-9]+%.org"             Replace match with: (spam)
1 0 "[A-Za-z0-9]+%.ro"               Replace match with: (spam)
5 0 "^[ХхXx]+[УуYy]+[Лл]+[ИиЬьЕеEe]$" Replace match with: #
5 0 "[%s%p ][ХхXx]+[УуYy]+[ЙйИиЕеEeЁёЭэЯяЮю]+$" Replace match with: #
5 0 "[МмM]+[УуYy]+[Дд]+[Ии]+[Лл]+[АаОоЫыЕеУуAaOoEeYy]+" Replace match with: #
5 0 "[Зз3НнH]+[АаAa]+[ЕеEe]+[Бб]+[АаAa]*[Лл]+[Ии]*" Replace match with: #
5 0 "[Гг]+[АаОоAaOo]+[НнH]+[Дд]+[ОоOo]+[НнH]+" Replace match with: #
5 0 "[%s%p ][УуYy]*[ЁёЕеEe]+[Бб]+"   Replace match with: #
5 0 "[Пп]+[ИиЕеEe]+[Дд]+[ОоАаЕеOoAaEe]+[РрPp]+[АаAa]+[СсЗз3Cc]+" Replace match with: #
5 0 "[ХхXx]+[УуYy]+[ЙйИи]+[Лл]+[ИиЕеEe]+[Щщ]+" Replace match with: #
5 0 "^[ХхXx]+[ЕеEe]+[РрPp]+$"       Replace match with: #
5 0 "[Пп][Ии][Дд][АаОоЕеAaOoEe][РрPp]"                   Replace match with: #
5 0 "[%s%p ][Cc]+[Oo]+[Cc]+[Kk]+$"   Replace match with: #
5 0 "[%s%p ][АаAa]+[ХхXx]+[УуYy]+[ЕеEeИиЙй]" Replace match with: #
5 0 "^[ХхXx]+[УуYy]+[ЁёЕеEe]+[ВвB]+$" Replace match with: #
5 0 "[НнЗз3H]+[АаAa]+[ХхXx]+[ЕеEe]+[РрPp]+" Replace match with: #
5 0 "[Гг][Оо][Нн][Дд][Оо][Нн]"       Replace match with: #
5 0 "[%s%p ][Пп]+[ЕеEe]+[Дд]+[Ии]+[КкKk]+[АаИиУуЕеОо]*[Мм]*[%s%p ]" Replace match with: #
5 0 "^[Лл][ОоOo][ХхXx]"             Replace match with: #
1 0 "[A-Za-z0-9]+%.net"             Replace match with: (spam)
1 0 "[Ww][Ww][Ww]%."                 Replace match with: (spam)

Code: [Select]
Showing patterns for: DE description (priority ordered)

Profile Actions Pattern Actions
________________________________________________________________________________

1 0 "%a+[.]%a+[:]+"                 Replace line with: NO SPAM !!!
1 0 "%S+://"                         Replace line with: NO SPAM !!!
1 0 "%d+%.%d+%.%d+%.%d+"             Replace line with: NO SPAM !!!
1 0 "%a+[.]%a+[.]%a+"               Replace line with: NO SPAM !!!
1 0 "[Ww][Ww][Ww]%."                 Replace line with: NO SPAM !!!


Code: [Select]
Showing patterns for: NI nickname (priority ordered)

Profile Actions Pattern Actions
________________________________________________________________________________

1 32 "%a+[.]%a+[:]+"                 Kick
1 32 "%S+://"                         Kick
1 32 "[Ww][Ww][Ww]%."                 Kick
1 32 "%S+%.%S+%.%S+"               Kick
1 32 "%d+%.%d+%.%d+%.%d+"             Kick


Code: [Select]
Showing patterns for: SE search (priority ordered)

Profile Actions Pattern Actions
________________________________________________________________________________

1 32 "[ПпPp][ЕеEe][ДдDd][ОоOo]"       Kick
1 32 "[Pp][Tt][Hh][Cc]"               Kick
1 32 "[Bb][Ll][Oo][Ww][Jj][Oo][Bb]"   Kick
1 32 "[ИиIi][НнNn][ЦцCc][ЕеEe][СсSs][ТтTt]" Kick
1 32 "[Мм][Ии][Нн][Ее][Тт]"           Kick
1 32 "[Мм][Аа][Лл][Оо][Лл][Ее][Тт][КкНн]" Kick
1 32 "[Нн][Ее][Сс][Оо][Вв][Ее][Рр][Шш][Ее][Нн][Нн][Оо][Лл][Ее][Тт][Нн]" Kick
1 32 "[Оо][Рр][Аа][Лл][Ьь][Нн][Ыы][Йй].[Сс][Ее][Кк][Сс]" Kick
1 32 "[Uu][Nn][Dd][Ee][Rr][Aa][Gg][Ee]" Kick
1 32 "[Гг][Рр][Уу][Пп][Пп][Оо][Вв][Оо][Йй].[Сс][Ее][Кк][Сс]" Kick
1 32 "[АаОо][Нн][Аа][Лл][Ьь][Нн][Ыы][Йй].[Сс][Ее][Кк][Сс]" Kick
1 32 "[ЛлLl][ЕеEe][СсSs][БбBb][ИиIi]" Kick
1 32 "[Rr][Aa][Pp][Ee]"               Kick
1 32 "[Ии][Зз][Нн][АаОо][Сс][Ии][Лл][ОоАа][Вв][Аа][Нн]" Kick
1 32 "[ПпPp][ОоOo][РрRr][НнNn][ОоOoУу]" Kick


Regards,
sergius_s
« Last Edit: October 30, 2013, 12:21:57 by sergius_s »
- I'm sorry for my terrible english...

Offline sergius_s

  • *
  • 236
  • Be yourself...
Re: Feature showroom - Patterns
« Reply #5 on: July 02, 2013, 10:54:18 »
Quote
<type>      What to check:
         MC = Mainchat
         PM = Personal messages
         RE = Reports
         SE = Searches
         SR = Searchresults

         NI = Nickname
         DE = Description
         EM = Email
         VE = Clientversion
         SS = Sharesize

I think that there does not list all types of pattern, perhaps there are other types of patterns?
- I'm sorry for my terrible english...

Offline FlipFlop™

  • FlexHub Developer
  • *****
  • 505
Re: Feature showroom - Patterns
« Reply #6 on: July 02, 2013, 17:58:59 »
Thanks for sharing the russian patterns!

The 10 patterntypes listed with !addpattern -h are all the patterns you can use.
Would you like more patterntypes? For what kind of data?
Check the new FlexHubList!           Add awesome statistics like this for your hub!

This post is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.

Offline sergius_s

  • *
  • 236
  • Be yourself...
Re: Feature showroom - Patterns
« Reply #7 on: July 02, 2013, 18:52:04 »
LadyStardust was writing:
Quote
!addpattern TA ".*0.668.*" -p-1 -a64 (User who will login with a client version: 0.668 will get banned from a hub)

This pattern is missing in the manual. I'm not meant something concrete, i saw this and i was curious :))
- I'm sorry for my terrible english...

Offline FlipFlop™

  • FlexHub Developer
  • *****
  • 505
Re: Feature showroom - Patterns
« Reply #8 on: July 03, 2013, 00:39:07 »
Ah, the TA is an old one and has been replace with VE (client version).

It doesn't use the entire tag to check for a pattern, but only the client part, for example "ApexDC++ 1.5.6"
Check the new FlexHubList!           Add awesome statistics like this for your hub!

This post is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.

Re: Feature showroom - Patterns
« Reply #9 on: January 12, 2014, 20:35:07 »
Hello, I refresh the topic.

I have a problem with checking prefixes (if anyone has not yet registered). A problem applies as follows.

The command has been added.
Quote
!addpattern NI "!![REG]" -p-1 -a32
Well, here begins the stairs, because in general I don't want this option to work. I would add that it was not made ​​to restart the hub (if it is so important). And I would like to make it work, what can be do with it.

I will be grateful for any answer to solve this problem. Thank you.
..:: eXodus DC HuB™ ::..   exodusnet.org:1411

Offline FlipFlop™

  • FlexHub Developer
  • *****
  • 505
Re: Feature showroom - Patterns
« Reply #10 on: January 13, 2014, 01:41:30 »
Because the [ and ] are special characters for pattern matching, you have to escape them with %.
The following characters have to be escaped with % if you want to match them literally: ( ) . % + - * ? [ ^ $

So if you want to kick unregistered users with "!![REG]" in their nickname, use:

!addpattern NI "!!%[REG%]" -p-1 -a32

Or if you also want to match lowercase versions of REG you can use this instead:

!addpattern NI "!!%[[Rr][Ee][Gg]%]" -p-1 -a32

Hope that helps.

Check the new FlexHubList!           Add awesome statistics like this for your hub!

This post is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.

Re: Feature showroom - Patterns
« Reply #11 on: January 13, 2014, 12:00:08 »
Thank you, works as it should.
..:: eXodus DC HuB™ ::..   exodusnet.org:1411

Offline sergius_s

  • *
  • 236
  • Be yourself...
Re: Feature showroom - Patterns
« Reply #12 on: June 24, 2014, 10:19:57 »
I want to make a clarification:

I changed or deleted many patterns later, so use them wisely and see what comes out of this  ;)
- I'm sorry for my terrible english...