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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
harley
Apprentice


Joined: 05 Apr 2008
Posts: 121

PostPosted: Sat Apr 05, 2008 7:45 pm   

regex
 
I can see the point some of the time for regex triggers
but why are they more desireable vs zScript Triggers?
Faster? just curious on everyones opinioins
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Sat Apr 05, 2008 7:49 pm   
 
Optional string segments in the pattern is why i am thinking of learning it.
_________________
Discord: Shalimarwildcat
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sat Apr 05, 2008 8:01 pm   
 
Ultimately everything in the TRIGGER syntax is translated into a regex.
The TRIGGER syntax is simpler easier to learn/write but can only express some things in the regex language.
Sometimes what you need to match is very complicated and beyond the ability of TRIGGER to express precisely.
In that case you skip the translator and use a REGEX.

In other words TRIGGER is like using a translator that only speaks a little of the language you need to express.
It never makes mistakes but there are things it can't say very well and ideas get lost.
with REGEX you lose the translator and say what you have to say, but if you don't know the language well you can make mistakes,
or be even less effecient than the limited vocab of the translator.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Apr 05, 2008 8:52 pm   
 
There are some things that the zScript trigger syntax can't do. The most common is using wildcards inside the {one|two} syntax. Sometimes you need to use one of these missing features, and so you can use regexes.

Regexes also allow much greater control over the matching engine. People who have a lot of triggers can often spend a lot of time fine-tuning their regexes to improve their matching speed.

For everyday tasks, though, the zScript syntax is simpler and it works. Most people don't need to use regexes - if you find that you're having trouble writing a trigger to match some particular text, though, a regex is usually what you need.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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