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

 Related 
Contents
Comparison
  %begins
  %ends
  %len
  %pos
  %regex
Function Reference
  %abs
  %additem
  %addkey
  %alarm
  %alias
  %ansi
  %array
  %arrget
  %arrhigh
  %arrset
  %ascii
  %average
  %begins
  %bitand
  %bitnot
  %bitor
  %bitxor
  %btncol
  %btnenable
  %btnimage
  %case
  %char
  %charcomment
  %charnotes
  %class
  %clip
  %color
  %colorname
  %comactive
  %comcreate
  %comget
  %comset
  %concat
  %copy
  %count
  %countlist
  %crtonl
  %db
  %dbget
  %dblist
  %dbmax
  %dbmin
  %dde
  %ddeclose
  %ddemacro
  %ddeopen
  %ddepoke
  %defined
  %delete
  %delitem
  %delkey
  %delnitem
  %destroom
  %dice
  %diceavg
  %dicedev
  %dicemax
  %dicemin
  %doorname
  %dups
  %ends
  %eval
  %exec
  %expand
  %expanddb
  %expandlist
  %filesize
  %find
  %float
  %format
  %getglobal
  %grep
  %gsl
  %handle
  %if
  %insert
  %int
  %inwalk
  %isfloat
  %iskey
  %ismember
  %isnumber
  %item
  %lastdir
  %left
  %leftback
  %len
  %literal
  %look
  %lower
  %match
  %mapfilter
  %maplocked
  %mapquery
  %mapvnum
  %max
  %mcp
  %min
  %mod
  %mss
  %nextdir
  %nltocr
  %norm
  %null
  %number
  %numbuttons
  %numitems
  %numkeys
  %numparam
  %numrec
  %numrooms
  %numwords
  %numzones
  %param
  %parsemode
  %pathcompress
  %pathexpand
  %pathfrom
  %pathreverse
  %pick
  %pop
  %portal
  %portalenabled
  %pos
  %prompt
  %proper
  %push
  %query
  %quote
  %random
  %read
  %regex
  %remove
  %repeat
  %replace
  %replaceitem
  %reversedir
  %right
  %rightback
  %roomcol
  %roomcom
  %roomcontents
  %roomcost
  %roomdesc
  %roomexit
  %roomflags
  %roomid
  %roomkey
  %roomkind
  %roomlink
  %roomload
  %roommob
  %roommode
  %roomname
  %roomnote
  %roomnum
  %roomobj
  %roomportal
  %roomvnum
  %roomzone
  %round
  %setglobal
  %sort
  %sqrt
  %state
  %stdev
  %string
  %stripansi
  %stripq
  %subchar
  %subregex
  %sum
  %time
  %trigger
  %trim
  %trimleft
  %trimright
  %upper
  %viewrec
  %walk
  %walkactive
  %walkconfirm
  %walkmode
  %walkroom
  %window
  %word
  %write
  %yesno
  %zonename
  %zonenum
  %zonevnum
Related Links:
  Setting up the automapper.
  Introduction to Triggers
  Quick Filters
  Using Database Views
  Setting View Filters
  Advanced Database usage
  Manual Mapper configuration
  Speedwalking with the Map
  Slow Walking
  Special Characters
  Trigger Options
  Trigger Types
  Trigger States
  #ALARM
  #FIND
  #MAPQUERY
  #MXPTRIG
  #ONINPUT
  #QUERY
  #REGEX
  #SCROLL
  #TRIGGER
  #VIEW
  Function Reference
  %grep
  %match
  %mapfilter
  %query
  %regex
  %subregex
  Trigger Command Options
  Predefined Variables
  Expressions
  Pattern Matching
  Message
  Match
  RegReplace
  Regular Expression Options
  Regular Expressions
  GetElementsByTagName
  GetElementsByTagNameNS
  FindFiles
  Documentation Viewer
  Events
  SearchText
  Template
  XSL
  Template
  Shared Package Library
  %grep
  %match
  %mapfilter
  Room Numbers
  %query
  %regex
  %subregex
  Comparison
  #ALARM
  #FIND
  Display
  #MAPQUERY
  #MXPTRIG
  #QUERY
  #REGEX
  #SCROLL
  Automapper
  #TRIGGER
  Files
  #VIEW
  Database
  Introduction to Triggers
  Predefined Variables
  Pattern Matching
  Editing Triggers
  Triggers
  Quick Filters
  Advanced Database usage
  Using Database Views
  Setting View Filters
  Speedwalking with the Map
  Manual Mapper configuration
  General GSL
  Simutronics Support
  Searching
  4: Simple Functions
  7: More Flow Control
  #WAITFOR
  #WAITSIGNAL
  %threadid
  Trigger Types
  ATCP
  Triggers
  Multistate triggers
  Advanced subregex
  Whats new in v3
  Pattern Wizard
  GMCP Support
%match [[%match]] 
match

Syntax: %match(s,pattern[,var1,var2,...varN,varN+1])
Related:
#TRIGGER, %subregex, %regex

test to see if string s matches the given Pattern. If it matches, the position of the match in the string is returned (starting with 1). If it doesn't match, zero is returned. The optional VarN arguments contain the names of variables to store any captured subpatterns (subpatterns surrounded by parenthesis). The additional VarN+1 variable name can be specified to hold the length of the matched pattern.

Examples:

#SHOW %match("Zugg says Hi","(%w) says (*)",Name,Message,X)

displays:

1
and sets the @Name variable to "Zugg", the @Message variable to "Hi" and the @X variable to 12
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net