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

 Related 
Contents
Creation
  #ACTION
  #ALARM
  #CONDITION
  #MXPTRIG
  #ONINPUT
  #SETPROMPT
  #TEMP
  #TRIGGER
Command Reference
  #
  #ABORT
  #ACTION
  #ADD
  #ADDITEM
  #ADDKEY
  #AFK
  #ALARM
  #ALIAS
  #ALL
  #BACKUP
  #BEEP
  #BREAK
  #BUTTON
  #C-
  #C+
  #CALL
  #CAPTURE
  #CASE
  #CHARACTER
  #CLASS
  #CLOSE
  #CLR
  #COLOR
  #COM
  #CONDITION
  #CONFIGURE
  #CONNECT
  #CR
  #CW
  #DBCLOSE
  #DBDELETE
  #DBFIRST
  #DBGET
  #DBLOAD
  #DBNEXT
  #DBOFFLINE
  #DBONLINE
  #DBPREV
  #DBPUT
  #DBRESET
  #DBSAVE
  #DDE
  #DEFAULT
  #DELCLASS
  #DELITEM
  #DELKEY
  #DELNITEM
  #DESCRIBE
  #DIRECTION
  #DISCONNECT
  #DOOR
  #ECHO
  #ECHOPROMPT
  #EDITOR
  #ERASE
  #EVALUATE
  #EXECUTE
  #FILE
  #FIND
  #FORALL
  #FREEZE
  #FTP
  #FUNCTION
  #GAG
  #GAGBLOCK
  #GAGOFF
  #GAGON
  #GALIAS
  #GAUGE
  #GVARIABLE
  #H-
  #H+
  #HELP
  #HIGHLIGHT
  #HISTORY
  #HOST
  #IF
  #IGNORE
  #IMAGE
  #INPUT
  #KEY
  #KILLALL
  #LAUNCH
  #LMAP
  #LOAD
  #LOG
  #LOOK
  #LOOP
  #LOOPDB
  #LOOPVIEW
  #MAKEROOM
  #MAKEWINDOW
  #MAP
  #MAPQUERY
  #MARK
  #MATH
  #MEDIA
  #MENU
  #MERGE
  #MESSAGE
  #MOVE
  #MSS
  #MXP
  #MXPTRIG
  #NAME
  #NEW
  #NODEF
  #NODIR
  #NOMAP
  #NOOP
  #OK
  #ONINPUT
  #PATH
  #PATHHIGH
  #PAUSE
  #PCOL
  #PICK
  #PLAY
  #PLUGIN
  #PORTAL
  #PRIORITY
  #PROMPT
  #PSUB
  #PW
  #QUERY
  #QUEUE
  #READ
  #RECALL
  #RECORD
  #REGEX
  #RENAME
  #REPEAT
  #RESET
  #RESUME
  #RETRACE
  #SAVE
  #SAY
  #SAYPROMPT
  #SCRIPT
  #SCROLL
  #SEND
  #SENDPROMPT
  #SESSION
  #SET
  #SETPROMPT
  #SHOW
  #SHOWARR
  #SHOWDB
  #SHOWPROMPT
  #SLOW
  #SS
  #STATE
  #STATUS
  #STEP
  #STOP
  #STWIN
  #SUBSTITUTE
  #SUSPEND
  #T-
  #T?
  #T+
  #TAB
  #TAG
  #TELEPORT
  #TEMP
  #TIMER
  #TRIGGER
  #TSET
  #TYPE
  #TZERO
  #UNALIAS
  #UNBUTTON
  #UNCLASS
  #UNDIR
  #UNGAG
  #UNKEY
  #UNMENU
  #UNPORTAL
  #UNTAB
  #UNTIL
  #UNTRIGGER
  #UNVAR
  #UNWATCH
  #URL
  #VARIABLE
  #VERBATIM
  #VERSION
  #VIEW
  #WAIT
  #WALK
  #WATCH
  #WHILE
  #WINDOW
  #WIZLIST
  #WRAP
  #WRITE
  #YESNO
#REGEX [[#REG]] 
REGEX

Syntax: #REGEX [id] pattern commands [classname] [options]
Related: #TRIGGER, %regex

Creates a unix regular expression trigger. The pattern field is the regular expression. It is expanded for @var variable references. The following regular expression patterns are supported:

. match any single character
* match zero or more of the previous pattern
+ match one or more of the previous pattern
? match zero or one of the previous pattern

(exp) group the regular expression "exp" into a single pattern. The matching pattern is stored in the %1..%99 variables.
(?:exp) group the regular expression as above, but do NOT store the value in the %1..%99 variables.

exp1 | exp2 match expression exp1 OR expression exp2. Any number of expressions can be listed, separated by |

[abc] match a range of letters. In this case, the letters a, b, or c are matched. You can specify a range of characters using the - operator. For example [a-z] matches any lowercase character. Putting ^ before the range defines a range of characters that are excluded. For example [^a-z] matches anything *except* a lowercase character.

^ matches the beginning of line
$ matches the end of the line

\ escapes the next character, matching that character verbatim. For example \* matches an asterisk. \ matches a slash itself. Note that to prevent zMUD variable parsing the @ character must still be escaped with the normal zMUD escape character (default of ~) rather than the \ character.

\s a space character (ascii 32)
\p the | pipe character
\w a word delimiter (matches a-zA-Z0-9)
\a a letter (matches a-zA-Z)
\d a digit (matches 0-9)
\h a hex character (0-9A-F)
\n matched a newline for multiline triggers

Like normal zMUD triggers, a subpattern can be enclosed in parenthesis to save it's matching pattern to the %1..%99 variables. To match a group of patterns without saving it to %nn, use the (?:exp) syntax. To save a subpattern to a named zMUD variable (like the &Varname syntax for normal triggers), use the (?Varname:exp) syntax.

Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright
by the University of Cambridge, England. http://www.pcre.org/.

For additional help on Perl Regular Expressions, go to http://www.perldoc.com/perl5.6/pod/perlre.html

REGEX Example

#REGEX {a+} {#CW high,red}
Matches one or more 'a' characters and colors them red.

#REGEX {(Zugg|Darker)} {#CW high,red}
Matches any line that contains the word "Zugg" or the word "Darker" and colors the word in red.
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net