|
|
Author |
Message |
Bat
Joined: 08 Aug 2007 Posts: 4
|
Posted: Wed Aug 08, 2007 11:29 am Post subject: loot string problem in dklp |
|
|
I'm setting up a pattern to recognise loot commands given a channel called test by anyone in it.
the lines that should be recognised look like (EQ1 logs)
| Code: |
[Tue Jun 01 21:00:00 2007] You tell test:1, 'loot char1 - item1 - 10'
|
but for some reason the pattern filled in in the preferences, doesn't seem to pick it up.
| Code: |
\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})\].*?tell.{1,2}test:\d+.*?[Ll]oot (\w+) - (.*?) - (\d+)'
|
The pattern gives the correct result if I use it in the following perl-script.
| Code: |
#!/freeware/bin/perl
$infilename=$ARGV[0];
$outfilename=$ARGV[1];
#$infilename="something.in";
#$outfilename="something.out";
open(IN,$infilename);
open(OUT,">$outfilename");
while ($_=<IN>){
$tmp=$_;
if ($tmp =~ m/\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})\].*?tell.{1,2}test:\d+.*?[Ll]oot (\w+) - (.*?) - (\d+)'/)
{
print "found\n";
}
else{
print"nada\n";
}
}
|
Am I missing something (perl vs java?) or did I stumble on a parsing bug ?
(word wrapping is messing up the code a bit, patterns are on a single line). |
|
Back to top |
|
 |
Lokorin Site Admin
Joined: 03 Apr 2006 Posts: 697
|
Posted: Wed Aug 08, 2007 8:35 pm Post subject: Re: loot string problem in dklp |
|
|
| Bat wrote: |
the lines that should be recognised look like (EQ1 logs)
| Code: |
[Tue Jun 01 21:00:00 2007] You tell test:1, 'loot char1 - item1 - 10'
|
but for some reason the pattern filled in in the preferences, doesn't seem to pick it up.
| Code: |
\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})\].*?tell.{1,2}test:\d+.*?[Ll]oot (\w+) - (.*?) - (\d+)'
|
|
It does pick up
| Code: |
| [Tue Jun 01 21:00:00 2007] You tell test:1, 'loot char - item1 - 10' |
for me (note "char" instead of "char1").
If it's not picking up people that only have letters in their name for you then please provide your configuration ("Export" -> "Configuration" in the menu) and I will test with that too. Please also provide the log that you're testing against if possible (you can e.g. PM it if you don't want it public). |
|
Back to top |
|
 |
Bat
Joined: 08 Aug 2007 Posts: 4
|
Posted: Thu Aug 09, 2007 12:44 pm Post subject: |
|
|
Thanks for the response.
Seems to pick it up now. Isn't \w supposed to pick up any alphanumerical character [a-zA-Z0-9_] ?
edit : typo in the config file. Solved now. |
|
Back to top |
|
 |
Lokorin Site Admin
Joined: 03 Apr 2006 Posts: 697
|
Posted: Thu Aug 09, 2007 9:11 pm Post subject: |
|
|
| Bat wrote: |
| Seems to pick it up now. Isn't \w supposed to pick up any alphanumerical character [a-zA-Z0-9_] ? |
You're right, I always thought that it only picked up [a-zA-Z]. |
|
Back to top |
|
 |
|