Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
dagnon99
Beginner


Joined: 08 Jun 2005
Posts: 12

PostPosted: Fri Jun 10, 2005 9:32 pm   

#REGEX vs. # Trigger
 
I have found that most triggers that i find here on the forums do not work for me. However, all the the #regex ones do.

The example is my privious question.

My gauge fot Status post:
some one posted a trigger answer, but it did not work.
Then some one posted a #regex answer and this did work.


My guage for Attributes post:

I got a Trigger answer that looks like it should work, but does not.

What are the differnces between the two and why would #regex be better at certain things?

(I have the latest and greatest release)
_________________
HJB
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Fri Jun 10, 2005 10:02 pm   
 
Regex is more advanced. zMuds normal triggers are converted to regex internally. One of zMuds main goals is ease of use. Regex is not for the faint of heart and, in some cases, gets downright ugly and impossible to read. zMud expressions were put in place so people with no real regex experience could still do powerful pattern matching without all of the ugly expressions. You can think of zMuds normal triggers as a slightly watered down easier to read version of regex. As such it simply does not do everything a real regex can (like back references or zero width assertions). There are not many cases where the normal triggers are not the best choice but you can run across one now and again and its nice to have the choice...
Reply with quote
dagnon99
Beginner


Joined: 08 Jun 2005
Posts: 12

PostPosted: Fri Jun 10, 2005 11:34 pm   
 
Thx Maelstorm...

How do i get to learn some in depth things on #regex? Question
_________________
HJB
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Jun 11, 2005 12:32 am   
 
Here is the best link I have for regular expressions. This is a very comprehensive site, and has some information specific to perl within the regex page. However the regex implementation in zMud follows the specifications in this document very well.

http://www.xav.com/perl/lib/Pod/perlre.html
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Sat Jun 11, 2005 12:34 am   
 
Some basic google searchs will of course yeald some results (not all of which are very useful).

Perhaps you have heard of the computer language called perl? Very interesting language that one. Probably because it was created by a linguist. Anyhow its primary purpose is as a text processor. As such it has built into the language itself pattern matching based from regular expressions. The perl regex reference guides are the end all and be all of regex knowhow as far as I am concerned...

Perl regex quick reference
http://search.cpan.org/~nwclark/perl-5.8.7/pod/perlrequick.pod

More complete and complex
http://search.cpan.org/dist/perl/pod/perlre.pod
Reply with quote
dagnon99
Beginner


Joined: 08 Jun 2005
Posts: 12

PostPosted: Sat Jun 11, 2005 1:07 am   
 
thx guyz... looks like i got some reading up do do! I want to make Zmud dance.. so i'd better learn the music!

thx again!
_________________
HJB
Reply with quote
demoneyoungblood
Apprentice


Joined: 16 Dec 2002
Posts: 114
Location: USA

PostPosted: Fri Jun 17, 2005 12:09 pm   
 
the best place you can go for general info on regular expressions is ironically http://regular-expressions.info
It covers regex in general. Might find it a bit easier to understand than the perl pages, even though its the same concepts, it breaks it down into a much easier to understand level. Also, do a google for regex coach, nice little program that can help you find out if your regex matches what you are trying to match..
:)
_________________
-Demone YoungBlood
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net