REGEX

Regular expression pattern matching

===================================================
main definitions:
  rxmatch          single match
  rxmatches        all matches

  rxcomp           compile pattern
  rxfree           free pattern handles
  rxhandles        list pattern handles
  rxinfo           info on pattern handles

regex utilities:
  rxeq             -:
  rxin             e.
  rxindex          i.
  rxE              E.
  rxfirst          {.@{    (first match)
  rxall            {       (all matches)
  rxrplc           search and replace
  rxapply          apply verb to pattern

  rxerror          last regex error message

other utilities:
  rxcut            cut string into nomatch/match list
  rxfrom           matches from string
  rxmerge          replace matches in string

===================================================
Form:
  here:  pat      = pattern, or pattern handle
         phnd     = pattern handle
         patndx   = pattern;index  or  phnd,index
         str      = character string
         bstr     = boxed list of str
         mat      = result of regex search
         nsub     = #subexpressions in pattern

 mat=.            pat   rxmatch   str
 mat=.            pat   rxmatches str

 phnd=.                 rxcomp    pat
 empty=.                rxfree    phnd
 phnds=.                rxhandles ''
 'nsub pat'=.           rxinfo    phnd

 boolean=.        pat   rxeq      str
 index=.          pat   rxindex   str
 mask=.           pat   rxE       str
 bstr=.           pat   rxfirst   str
 bstr=.           pat   rxall     str
 str=.     (patndx;new) rxrplc    str
 str=.     patndx (verb rxapply)  str

 errormsg=.             rxerror   ''

 bstr             mat   rxcut     str
 bstr=.           mat   rxfrom    str
 str=.         new (mat rxmerge)  str

Defined items
NameClassDescription
rxmatchVerbsingle match
rxmatchesVerball matches
rxcompVerbcompile pattern
rxfreeVerbfree pattern handles
rxhandlesVerblist pattern handles
rxinfoVerbinfo on pattern handles
rxeqVerbregex equivalent of -:
rxinVerbregex equivalent of e.
rxindexVerbregex equivalent of i.
rxEVerbregex equivalent of E.
rxfirstVerbregex equivalent of {.@{ (first match)
rxallVerbregex equivalent of { (all matches)
rxrplcVerbsearch and replace
rxapplyVerbapply verb to pattern
rxerrorVerblast regex error message
rxcutVerbcut string into nomatch/match list
rxfromVerbmatches from string
rxmergeVerbreplace matches in string

rxmatch............. (v) single match

rxmatches........... (v) all matches

rxcomp.............. (v) compile pattern

rxfree.............. (v) free pattern handles

rxhandles........... (v) list pattern handles

rxinfo.............. (v) info on pattern handles

rxeq................ (v) regex equivalent of -:

rxin................ (v) regex equivalent of e.

rxindex............. (v) regex equivalent of i.

rxE................. (v) regex equivalent of E.

rxfirst............. (v) regex equivalent of {.@{ (first match)

rxall............... (v) regex equivalent of { (all matches)

rxrplc.............. (v) search and replace

rxapply............. (v) apply verb to pattern

rxerror............. (v) last regex error message

rxcut............... (v) cut string into nomatch/match list

rxfrom.............. (v) matches from string

rxmerge............. (v) replace matches in string


system\main\regex.ijsRelease: 4.02/1998-11-13/12:26