Testing trigger patterns

Post Reply
User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Testing trigger patterns

Post by Vadi »

Firefox was kind enough to crash and lost my first post, so this one is short. How about having an input box for the line(s) you'd like to test against, and another one that displays results? How Kiki does it:

http://www.ubuntu-pics.de/bild/14696/sc ... brTU21.png
http://www.ubuntu-pics.de/bild/14697/sc ... oOM3a2.png

Caled
Posts: 403
Joined: Thu Apr 09, 2009 4:45 am

Re: Testing trigger patterns

Post by Caled »

Having this built in could be handy, I guess. I use
http://www.regexpal.com/
at the moment, so its not a major thing for me. Before I found a link to that site though, I was using the one built into CMUD, which I quite like because it displays the values of the capture groups as well. If you do go to the effort of building one into mudlet, that is a feature I suggest.

Everest
Posts: 10
Joined: Wed Apr 22, 2009 4:50 am

Re: Testing trigger patterns

Post by Everest »

Hmm, I like this. A lot.

One thing I'd like is, if a trigger doesn't match, an easy way to find out which variable is causing it to not match. Kiki seems to do a great job of telling you which variable is which, but maybe I'd like an option to match word by word and see where in the output ("Matches" tab) it stops.

For example, if you messed up with the his/her part of your example, it would output:

0: (Taraza) takes some salve from a vial and rubs it on

This way you could see exactly where the error is.

But then again, maybe you're thinking of implementing a "code checker" that would flag the error once you stopped typing the regex. Like spell check for code.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Testing trigger patterns

Post by Vadi »

I see what you mean, but that wouldn't be helpful in the case of regexes. They can be very complex and the engine itself is complicated too - I don't think anyone ever came up with such a thing.

Everest
Posts: 10
Joined: Wed Apr 22, 2009 4:50 am

Re: Testing trigger patterns

Post by Everest »

Well then I think what you've suggested is an excellent start. It's easy to find the variables, and handles testing multi-line triggers really easily. Although it sounds like Caled would like a list of variables and their contents instead of the way Kiki shows you? Personally I think Kiki's way is much more efficient; you don't need a list, you can just look at what's in the parenthesis.

Caled
Posts: 403
Joined: Thu Apr 09, 2009 4:45 am

Re: Testing trigger patterns

Post by Caled »

The way Kiki does it is fine, I was just saying that its the only thing
http://www.regexpal.com/
doesn't seem to have.

Edit:
I wouldn't mind an example of how Kiki displays something like this though:

^go(d)?(s|g)?(\s([A-Za-z' ]*))?$

go
gos
godg
go ollin
godg severn shrine kelsys

The bit I'm interested in, is the capture group inside the capture group, and how it will display the difference between the two (3rd and 4th matches in this case).

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Testing trigger patterns

Post by Vadi »

It's Python, so probably regex-implementation specific.
Attachments
screenshot_100(059).png
screenshot_100(059).png (56.2 KiB) Viewed 7936 times

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Testing trigger patterns

Post by Vadi »

Added kiki's help files here: http://drop.io/mudlet1 I think it runs on Windows too.

Post Reply