mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 71
D
D00M Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Oct 2005
Posts: 71
hey all,i have a line in a script (filter list) that is getting pretty big and iv noticed that mirc wont let me use more than 950 letters/spaces etc... in 1 line.
How would i go about continuing the line as i need to add more to it and still make the script work ok? (if you need more info plz ask wink)

Code:
  var %noshow = /(?:test|spam|xxx|\.satrip\.|\.mp3\.|vinyl|french\.|\.french\.|\.french-|\_french\_|\_french-|\.swedish\.|\.swedish-|\.danish\.|\.danish-|\.german\.|\_german\_|\.german-|germany\.|\.germany\.|\_germany\_|\.der\.|\.russian\.|\.russian-|\.spanish\.|\.spanish-|\.belgian\.|\.belgian-|\.dutch\.|\.dutch-|\.czech\.|\.czech-|\.greek\.|\.greek-|\.italian\.|\_italian\_|\.italian-|\.portuguese\.|\.iceland\.|\.iceland-|\.japan\.|\.japan-|\.norwegian\.|\.norwegian-|\.nordic\.|\.nordic-|\.holland\.|\.holland-|\_holland\_|\.hungarian-|\.hungarian\.|\.hundub-|\.hundub\.|\_Hungarian-|\_Hungarian\_|\.hentai\.|\.hentai-|\.fansubbed\.|\.fansubbed-|\.fansubbed_|\.fansub\.|\.finsub\.|\.heb\.|\.swe\.|\.swesub\.|\.swesub-|\.norsub\.|\.plsub\.|.\kordub\.|korsub\.|\.czsub-|\.nlsubs\.|\.subfrench\.|\.pldub\.|\.pldub-|\.custom\.|\.es-|EST|\.jp\.|\.jap\.|\_jap\_|\.jpn\.|\_jpn\_|\_jp\_|\-jpn\-|\.nl\.|\.sp\.|\.fr\.|\.pl\.|\.pl-|\.kor\.|\-fr\-)/iS

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Just make another variable, and add another $regex under the first one.

var %one = /(long|string|of|regex|gibberish)/i
if ($regex(,$1-,%one)) echo -a Regex 1 matched
var %two = /(another|string|of|gibberish)/i
if ($regex(,$1-,%two)) echo -a Regex 2 matched

-genius_at_work

Joined: Jul 2004
Posts: 31
H
Ameglian cow
Offline
Ameglian cow
H
Joined: Jul 2004
Posts: 31
You can cut down the code a lot aswell:

/(?:test|spam|xxx|(?:\.|_|-)?(?:satrip|mp3|vinyl|french|swedish|danish|germany?|der|russian|spanish|belgian|dutch|czech|greek|italian|portuguese|iceland|japan|norwegian|nordic|holland|hungarian|hundub|hentai|fansub(?:bed)?|heb|(?:swe|nor|pl|kor|cz|nl|sp|fr)(?:(?:s|d)ubs?)?|subfrench|custom|es|EST|j(?:a?p|pn))(?:\.|_|-)?)/iS

321 chars.

if you're not gonna work with back references, leaving out all ?: will give you another 18 chars at the cost of 6 or 7 backreferences added at most per check.

Last edited by hmtX; 14/06/06 03:15 PM.
Joined: Oct 2005
Posts: 71
D
D00M Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Oct 2005
Posts: 71
Great,just the answers i was looking for,thanx for the tips guys,its all working nicely.
I didnt use yours hmtX as im only just starting to learn how this regex code works (at a very basic level) and for me to edit yours for more filters confused me a little (but will keep for futher learning,maybe a quick explaination/breakdown of your code?),again thanx guys wink grin

Joined: Jul 2004
Posts: 31
H
Ameglian cow
Offline
Ameglian cow
H
Joined: Jul 2004
Posts: 31
it's not hard at all.

Code:
/(?:test|spam|xxx| <- one of those, or:
    (?:\.|_|-)? <- can begin with . or _ or - but does not have to
       (?: ... ) <- huge list of words that can be surrounded by those ._-'s, noteworthy parts are:
{
germany? <- matches german and germany
fansub(?:bed)? <- matches fansub and fansubbed
(?:swe|nor|pl|kor|cz|nl|sp|fr)(?:(?:s|d)ubs?)? <- example matches: swe, swesub, swesubs, swedub, swedubs; i had a typo here first where there was an additional | after fr: ..|fr|)(..
j(?:a?p|pn) <- matches jp, jpn, jap
}
    (?:\.|_|-)? <- can end with . or _ or - but does not have to
)/iS

Last edited by hmtX; 14/06/06 03:16 PM.
Joined: Oct 2005
Posts: 71
D
D00M Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Oct 2005
Posts: 71
thanx for that hmtX,i understand it a lot better now.
I will put it in the script and see how i go at a later date with adding to it,
again thanx to both that helped grin


Link Copied to Clipboard