PDA

View Full Version : Can anyone explain the filter methods in detail plz



Gungadin
03-24-2002, 08:50 PM
I understand that each section of the filters file does different things, but was wondering if someone can explain 'regular expressions'. (i assume this is a Linux thing)
So far it seems that if you want to be alerted to a particular named mob, you use
Name:The Mobs Name Case Sensative (ie Name:Grimfeather)

Or for any mob of a particular race
Race:The Mobs Race Case Sensetive (Ie Race:Dark Elf)

And you can use a semicolon and numbers to specify a level range. (ie Race:Dark Elf;26-29)

But what about the [^:] expression, what does it mean?

What about when [^:] is followed by things like [^:]* or [^:]*: or [^:]*:.*

What is the difference between
Race:[^:]*Guard[^:]*:
Race:*Guard[^:]*:
Race:[^:]*Guard*:
Race:Guard*:
etc

And how does this sentance know that it's looking for an item of Light:GLS, not a level range of Light:GLS?
Name:[^:]*will[^:]*:.*:Light:GLS:.*

Also, is there any way to put in a filter for mobs with # at the front of their name other than using the search bar?

In summary, what are all the comoponents i can use to build a detailed and specific filter, including name, race, level limit and item held, plus anything else possible. And can we have this info put up into the docs section for everyone to access so no more questions about it from noobs like me :-)

Ant thanks to Blue Adept for the Zone specific filter files, a big time saver there.

Cryonic
03-24-2002, 09:59 PM
Try using search:

http://seq.sourceforge.net/showthread.php?s=&threadid=635&highlight=regular+expression

Gungadin
03-25-2002, 05:44 AM
Thanks Cryonic.
I was however hoping to get a brief explanation of what to put in and what the various examples given in the filters.conf are actually doing.

While learning Pearl might have it's attraction to most, i just wanna know how to set up a filters.cong file properly.

Seems like there are no shiotcuts in linux eh, you have to learn to fly before you can attempt to learn to crawl :-(

Well, i'll have a bash at it, and see if i can come up with something.

Thanks

Zaphod
03-25-2002, 10:05 AM
Use the following command to find out about regex:

info regex


The regex used by ShowEQ happens to be similar, but not the same as, Perls regular expression syntax. This isn't just a linux thing, they even use forms of regex under M$ Windows.

Enjoy,
Zaphod (dohpaZ)

Gungadin
03-26-2002, 04:07 PM
Well, I spoke to my flat mate (who has ben pearl programming for many many years), and he said it's not really pearl, but it he had to take a guess he thinks [^:] means that the next character should not be a colon, and that the * is a wild card for any number of characters. Sounds weird to me. why would you need to check for two consecutive colons?

Guess i'll keep on trying to decypher it (unless anyone out there wants to just tell me :-)

Zaphod
03-26-2002, 07:59 PM
Ok, for the clue impaired:
The filter strings that these expressions match against are colon (:) delimited
[^:] means match a non-colon character
[^:]* means match 0 or more non-colon characters
[^:]+ means match 1 or more non-colon characters
. matches any character
.* matches 0 or more any characters
.+ matches 1 or more any characters


Once again, learn to read, navigate around the info on regex using the command:

info regex


Enjoy,
Zaphod (dohpaZ)

Gungadin
03-27-2002, 03:49 PM
Thanks Zaphod.
I wasn't really sure what
Code:
info regex
means, and since i am away from home i can't type in into my linux box to see what happens, but I did surf the net, and found this usefull guide (basically same info as you provided) http://www.boost.org/libs/regex/syntax.htm#syntax

Being a none too sharp, i'm still trying to get to grips with it, but from what i can work out
Name:[^:]*bone*
would give a match to anything that starts with 'Name:' (as long as it wasn't followed immediately by another colon) then has bone in the name somewhere (ie won't give a match to 'Name::bonecharmer' but will match 'Name:bonecharmer:')

Is this elimination of the double colon for when you first zone in and the decoding hasn't been done yet, and so the stuff we are searching for is like Name::::: ? Just my guess here, i don't know exactly what the stuff we are searching through looks like (and don't really want to, i have spent far too much precious gaming time messing about with this as it is :-)

Also, if i wanna put an alert string in to alert for any mob who's name starts with an #, since i can't put the # in the config file i think i could use...
Name:[^(A-Z|a-z|:)]*
I think that means find anything that starts with 'Name:' then has a character that is not a letter or a colon, then anything (will try this out when i get home)

Anyway, i now have enuff info to play around and build my custom filters (and the other clueless people now have some more info to go on).

Thanks for your help and patience.