PDA

View Full Version : Reg Ex match?



Nobody
05-25-2002, 09:23 AM
If I wanted to match a combination that was

Gibartik
Gibentik
Gonar
Jonar

Would it be:

Name:[GJ](ib|on)(ar|en)(tik)+

?

Mr. Suspicious
05-25-2002, 01:37 PM
I'd say:

Name:.*[GJ][io][bn][ae][rn]*

the first .* isn't realy needed, but I made it a custom to always use it anyway.

Nobody
05-25-2002, 06:00 PM
Part of the problem is that pet names match a string.

First char is:
G,J,K,L,X,Z

Then there is a patern:

ab,an,ar,en,er,ib, etc

That cna be repeated up to 3 times.

Then there may or may not be a "tik" on the end.
In perl I'm searching with:

(G|J|K|L|V|X|Z)(ab|an|ar|as|eb|ek|en|er|ib|ob|on)+ (tik|n)*

Mr. Suspicious
05-25-2002, 07:49 PM
Ah, I understand. You're trying to identify pets.


Wouldn't it be more easy to filter on a few things to identify a pet?

Name, Race, Class, Level perhaps?

Name:.*[GJKLXZ][aeio]*;9-11:Race:Skeleton:Class:Warrior

for the level 12 Necromancer Pet for instance (http://eq.castersrealm.com/spells/spell.asp?Id=396), chances that there's a named spawn Skeleton with a name starting with G, J, K, L, X or Z + a second character a, e, i or o and in that level range is very small, if not non existant.

Cnf: /usr/local/share/showeq/filters.conf.dist

Nobody
05-29-2002, 11:19 AM
Then you have to have the same line for each possible combination of pet race and class. That's 16 searches for just mage pets. I think I have it with:

next if ( $_ =~ /^.:[G|J|K|L|V|X|Z][ab|an|ar|as|eb|ek|en|er|ib|ob|on]+[tik|n]*/ );

that just leaves out a few which are caught with:

next if ( $_ =~ /^.:[G|J|K|L|V|X|Z]tik/ );

Now I need to know how to filter out corrupted data. 2 different spawnlogs I've gotten have alot of ctrl characters in them.