AaIth HH $ d H6$$ff@  d#  Footnote TableFootnote**. . / - :;,.!?`O5/aTOCHeadingF);),///::=>C'sDylanGwydion Implementors InstantiablePerlR{n accessorsaeiou backreferencebackreferencesbunchabytecharactercountth delimiter delimitersdo(rcurry(checkentrancyeof filestreamfilename finder(This forceoutput getinputinputavailablelimited([illegal-regexp]ismsplittn /39414: Heading: The Regular-Expressions Libraryeregexpserregexp-positionoomake-regexp-positionerporregexp-replacemake-regexp-replaceru translatepreomake-translatorl make-splitterrstzjoinsPerl nsle(( cod' ole = 1  <$lastpagenum> *<$daynum01> <$shortmonthname> <$shortyear> "<$monthnum>/<$daynum>/<$shortyear> )<$daynum> <$shortmonthname> <$shortyear> ! "<$monthnum>/<$daynum>/<$shortyear>" <$monthname> <$daynum>, <$year># "<$monthnum>/<$daynum>/<$shortyear>$  <$fullfilename>O%  <$filename>&  <$paratext[Title]>'  <$paratext[Heading]>(  <$curpagenum>)  <$marker1>*  <$marker2>+  (Continued), + (Sheet <$tblsheetnum> of <$tblsheetcount>)nLi- Pagepage<$pagenum>-ge. Heading & Page <$paratext> on page<$pagenum>/ See Heading & Page%See <$paratext> on page<$pagenum>.p0  Table & Page7Table<$paranumonly>, <$paratext>, on page<$pagenum>e=m= Ui i Vj j Wk k Xl l Ym m Ale(Zn n A[o o \p p ]q q Amo^r - Acdac z r1. e(c | >2. ,| | /um/ a1 n$d2 e3| | o>/:| | $eaL| | fiTs  ^  Ws ele_s s teb| | >&w g'v a(w a)x od)*x t +v u<$,w nLi-x $p.y eHe0v ear/z ppaZ| He1 e<2  e 3| p4 abl5 o<6 ge7 e8 9  : ; < #= '> (? m ,@ l8A 9B <C  D DE GF IG oLH  MI RJ WK >2.XL  ZM  ^N  _O  aP  cQ  dR  hS  lT  mU  qV  rW  uX  9 Y  : Z  {[  }\  ~]  ^  _  `  d  e  f  g  h  i  j  k  l  m  n  o  p  r  s  t  u  v  w  x  {  3. | |  |d x| | }e d ) . 0 d) i n  d*  o q d4+  - - $H5, + $HX  -  UU@ heasily under d2c than under Mindy -- as few as two dozen lines of 80 column text under d2c for Windows. UU`  $H7- +  $Hlu , , ^H$ C ) H$  i d   Hw D ) Hw  j  d 3. H$ E ) | H$ dk d n  Hw F ) Hw l d  HHG ) HH m UUd  HHH ) deHH won text un inUUd  l" I * l" u , , o $n e22 May 97 f H J * H )Timep lan !jRunning H/F 2ig#h $HK * $H  q UUd  dL M X H#* M N L H#* HR HR FootnoteHr7 N M O L Hr7 HzHz  Single LineH'O N Q L P P Footnote mP O  de  wo  HR< Q O R L HR< HH  Double Line H R Q U L S T Double LineqS T R H sT S R H U R W L gV V Single LinevV U HZ W U X L  TableFootnoteϸE]G'E X W L ϸE]G'E ϸEwPϸEwP  TableFootnoteod Y r r Hz$H Z Y $H''r  'TU TU h (nThe lRegular-Expressions Library UU` Designed by the Gwydion Project QUATU ` Introduction VUU  ~The  Regular-expressions  library exports the  Regular-expressions  module, which contains various functions that bUU deal with regular expressions ( regexps ). The module is based on Perl (version 4), and has the same semantics unless nUU W otherwise noted. The syntax for Perl-style regular expressions can be found on page 103 of  Programming Perl  by Larry Wall zUU zand Randal L. Schwartz. There are some differences in the way  String-extensions  handles regular expressions. The UU ybiggest difference is that regular expressions in Dylan are case insensitive by default. Also, when given an unparsable UU@ jregexp,  String-extensions  will produce undefined behavior while Perl would give an error message. UU  ThA regular expression that is grammatically correct may still be illegal if it contains an infinitely quantified sub-regexp that VUU Thmay match the empty string. That is, if  R  is a regexp that can match the empty string, then any regexp containing  R* ,  R+ , UU prand  R{n,}  is illegal. In this case, the  Regular-expressions  library will signal an    error when the regexp UU@ l-jis parsed. Note: Perl also has this restriction, although it isnt mentioned in  Programming Perl . UU  RauIn previous versions of the regular-expressions library, each basic function had a companion function that would pre-UU bipcompute some information needed to use the regular expression. By using the companion function, one could avoid abUU zrecomputing the same information. In the present version, the regular-expressions library caches this information, so the UU r pcompanion functions are no longer necessary and should be considered obsolete. However, they have been kept for haUU@ backwards compatibility. t(UU   Companion functions differ in details, but they all essentially return curried versions of their corresponding basic function.  4UU@ egEFor example, the following two pieces of code yield the same result: nJUU`1 xp7regexp-position(This is a string, is); ed.`UU 2 as:let is-finder = make-regexp-positioner(is); lUU@2 +is-finder(This is a string); reUU`3 liaBoth pieces of code should have roughly the same performance, even if the code is inside a loop. o:UTU ` deExported Names larUU` inwThe following names are exported by the  Regular-Expressions  module of the  Regular-Expressions  library: n, UUh4 si' regexp-position [Function] he UU 5 r 6(big-string, regexp, #key start, end, case-sensitive) UU@5 ol"=> variable-number-of-marks-or-#f UU 6 This function returns the index of the start of the regular expression in the  big-string , or  #f  if the regular ied UU6 cvexpression is not found. As a second value, it returns the index of the end of the regular expression in the  big-UU6 1ustring  (assuming it was found; otherwise there is no second value). These values are called marks, and they come r%UU6 is{in pairs, a start-mark and an end-mark. If there are groups in the regular expression,  regexp-position  will return ro1UU6 fooan additional pair of marks (a start and an end) for each group. If the group is matched, these marks will be low=UU@6 rtIintegers; if the group is not matched, the marks will be  #f . So SUU`7 7regexp-position(This is a string, is); he iUU`8 r #returns  values(2, 4) , and d, UU`9 @regexp-position(This is a string, (is)(.*)ing); 6UU`: n 2returns  values(2, 16, 2, 4, 4, 13) , while d[ ifs s 6$H\ [ lu$Hx ((s h(UU`; stGregexp-position(This is a string, (not found)(.*)ing); se UU`< mareturns  #f . Marks are always given relative to the start of  big-string , not relative to the  start:  keyword. eg2UU = ilStart:  and  end:  specify what part of  big-string  to look at, and they default to the beginning and end of the string, l>UU@= 8respectively.  Case-sensitive  defaults to false. wYUUh> S*make-regexp-positioner [Function] eUU ? aF(regexp, #key byte-characters-only, need-marks, maximum-compile, case-qUU?  sensitive) }UU? io=> an anonymous positioner )iUU@? &method (big-string, #key start, end) UU @ e wMake-regexp-positioner  can return several different types of positioners, and it is up to the user to specify what UU@ kind of positioner the user wants. It returns a positioner that works like  regexp-position .  Needs-marks ,  byte-UU@@ inqcharacters-only , and  maximum-compile  are ignored, and are included only for backwards compatibility. UU` th!Note: This function is obsolete. UUhA t:"regexp-replace [Function] UU B inF(big-string, search-for-regexp, replace-with-string, #key count, case-UUB =sensitive, start, end) ase UU@B au=> new-string "UU C SThis replaces all occurrences of  regexp  in  big-string  with replace-string. If  count:  is specified, it replaces only the .UUC e)first count occurrences of  regexp . (This is different from Perl, which replaces only the first occurrence unless  /g  :UU@C ti^is specified)  Replace-string  can contain backreferences to the regexp. For instance, PUU D Dregexp-replace(The rain in Spain and some other text, ha\UU@D egGthe (.*) in (\\w*\\b), \\2 has its \\1) racrUU E lreturns  spain has its rain and some other text . If the subgroup referred to by the backreference No~UU@E isQwas not matched, the reference is interpreted as the null string. For instance, UU F s=regexp-replace(Hi there, Hi there(, Bert)?, UU@F it4What do you think\\1?) g UU`G SLreturns  What do you think?  because  , Bert  wasnt found. epUUhH (make-regexp-replacer [Function] tUU I C,(regexp, #key replace-with, case-sensitive) .UUI nt1=> an anonymous replacer function that is either eUUI -method (big-string, #key count, start, end) -UUI taor kr UU@I eg=method (big-string, replace-string, #key count, start, end) p#UU`J wThe first form is returned if the  replace-with:  keyword isnt supplied, otherwise the second form is returned. rac9UU` !Note: This function is obsolete. nTUUhK  %translate [Generic Function] `UU L ~?(big-string, from-string, to-string, #key delete, start, end) s tlUU@L or=> new-string UU M This is equivalent to Perls  tr///  construct.  From-string  is a string specification of a character set, and  to-string  UUU@M  is another character set.  Translate  converts  big-string  character by character, according to the sets. For instance, d] a-st t Int$H^ ] th$H %%key count  -%UU`N kr2translate(any string, a-z, A-Z) UU`O sJwill convert  any string  to all uppercase:  ANY STRING . 2UU`P or\Like Perl, character ranges are not allowed to be backwards. The following is not legal: unHUU`Q n2translate(any string, a-z, z-a) ^UU R (This restriction may be removed in future releases) Unlike Perls  tr/// ,  translate  doesnt return the number jUU@R ntof characters translated. UU S stIf  delete:  is true, any characters in the  from-string  that dont have matching characters in the  to-string  are deleted. cUU@S riRThe following will remove all vowels from a string and convert periods to commas: UU`T ?translate(any string, .aeiou, ,, delete: #t) UU U Delete:  is false by default. If delete: is false and there arent enough characters in the  to-string , the last character UUU A-{in the  to-string  is reused as many times as necessary. The following converts several punctuation characters into e PUU@U gespaces: alUU`V ar9translate(any string, ,./:;[]{}(), ); UU`W e(xStart:  and  end:  indicate which part of  big-string  to translate. They default to the entire string. trUU`X la:Caveats:   Translate  is always case sensitive. -UU`Y attranslate [G.F. Method] ՚9UU Z ueN(big-byte-string, from-byte-string, to-byte-string, #key delete, start, end) EUU@Z ng=> new-string [UU`[ SOThe only predefined method of  translate  operates only on byte strings. ommvUUh\ T+make-translator [Generic Function] eioUU ] t)'(from-string, to-string, #key delete) falUU] d=> an anonymous translator ntUU@] i4method (big-string, #key start, end) => new-string UU`^ Does what youd expect it to. UU`_ y."make-translator [G.F. Method] UU ` s 1(from-byte-string, to-byte-string, #key delete) UU` => an anonymous translator /:;UU@` 9method (big-string, #key start, end) => new-byte-string hUU` trIAgain, the existing method on make-translator only handles byte strings.  UUh msplit [Function] ,UU  -L(regexp, big-string, #key count, remove-empty-items, case-sensitive, start, e-8UU stend) oDUU@ d => a variable number of strings ZZUU d g This is like Perls  split  function. It searches  big-string  from occurrences of  regexp , and returns substrings that tofUU@d ct.were delimited by that regexp. For instance, |UU`e ) 0split(-, long-dylan-identifier) orUU f ]hreturns  values(long, dylan, identifier) . Note that what matched the regexp is left out. t d_ [Gu u `s $H` _ ete$H$$ator /:;u `$UU@f #ZRemove-empty-items , which defaults to true, magically skips over empty items, so that UU`g an5split(-, long--with--multiple-dashes) 2UU h nreturns  values(long, with, multiple, dashes) .  Count  is the maximum number of strings >UUh to return. If there are  n  strings and  count  is specified, the first  count  - 1 strings are returned as usual, and the JUU@h  3count th string is the remainder, unsplit. So U`UU`i imAsplit(-, really-long-dylan-identifier, count: 3) vUU j -drreturns  values(really, long, dylan-identifier) . If  remove-empty-items  is true, empty items UU@j larent counted. UU k uCase sensitive determines if the regexp for the delimiter should be considered case sensitive or not; it defaults to UUk case-insensitive.  Start:  and  end:  indicate what part of the big string should be looked at for delimiters. They eUU@k t -default to the entire string. For instance, oUU`l -dAsplit(-, really-long-dylan-identifier, start: 8) uUU`m  @returns  values(really-long, dylan, identifier) . hUU n IfvCaveat : Unlike Perl, empty regular expressions are never legal regular expressions, so there is no way to split a UUn vstring into a bunch of single character strings. Of course, in Dylan this is not a useful thing to do, so this is not UU@n ,really a problem. %UUho rn!make-splitter [Function] a1UU p . +(pattern :: , #key case-sensitive) it=UUp j=> an anonymous splitter IUUp CaDmethod (big-string, #key count, remove-empty-items, start, end) => idUUU@p e buncha-strings ts kUU` kDoes what you would expect. arUU` :%Note: This function is obsolete.  gUUhr atjoin [Function] UU`s de5(delimiter :: , #rest strings) => big-string UU`t &Does the opposite of a  split . UU`u +join(:, word1, word2, word3) lonUU`v tiis equivalent to UU`w Ca7concatenate(word1, :, word2, :, word3) r lUU`x ssD(and no more efficient) Note that there is no  make-joiner . a 1UUh ar!k [Class] t=UU` l WWhen an illegal regular expression is parsed, an error of this type will be signalled. 4U^TU `  Known bugs 1sUU  (ptThe regular expression parser does a very poor job with syntactically invalid regular expressions. Depending on the hoUU@ y Rexpression, the parser may signal an error, improperly parse it, or simply crash. UU  ksA regular expression that matches a large enough substring can produce a stack overflow. This can happen much more joH$ i j ) dimH$ lC C UtHw j i k )  Hw lD D VlonH$ k j l ) H$ lE E W woHw l k m ) eicHw lF F XUHHm l n ) t=HHlG G Yd, HHn m ) ^HHlH H Zulal" o p * tsyl" lI I [ H p o q * yigH lJ J \U$Hq p *  la$HlK K ]app$Hr Y  j $Hls Z Z ^$Hs [  k $Hlr t \ \ ^$Ht ]  l $Hls u ^ ^ ^$Hu _  m $Hlt - ` ` ^ d ) Leftn d * Rightd L  Referenced Y d [ ld ] H lad _ d + U f )$0fU Q %  1Heading 1Heading Rule. FirstBody. $$fV SE *$  1Step Step Number S:.\tStep.  fW  % 2Heading .. . ff2ff233@X  %H  t   h h Argument. fe @Y  %_ H     h  Body. 33+33$fZ B %ul33+n Bullet Bullet SymbolB:\t. ]K$f[ B % ]m Bullet2. Bullet SymbolB:\t. $$$f\  *CBullet. $$$f]  *CStep. ff2ff233@^  %H    h  Description. dd33@_  %H    hl   u Description2. \ff233@`  %H  u t mh:  DItem. KK@a  %$H    h  DItem2. 33 @b  %33 Endnote.\t. $0fc Q %  1Heading 1Heading Rule. FirstBody. @d  % Function Head. ff2ff2 @e  %H m    Ih   Function Body. 33 @g  % 33 Endnote1.\t. ff2K33@h  %H  t  >h  Extra Key Arg. ff2ff2 @i  %H  i   h  Function Body. @j  % Function Head. HHH fk T % HeadingBody. HHHfl D %  HeadingSub.  @m  %$    th  Parameter List. $$fn S *$ Step Step Number S:.\t. @o  H    h  Verbatim. fp  * CellHeadingd. fq  *CellBody. fr T *  TableTitleT:Table : . ff2ff2 @s  %H    h  Function Body. @v  *  Header. @w  *   Footer. fx  %Body. HHH fy T % HeadingBody. HHHfz D %  HeadingSub. $0f{ Q %  1Heading 1Heading Rule. FirstBody. @|  %H    h  Body. @  % Function Head. ff2ff2 @  %H    h  Function Body . @  H    h  Verbatim.  @  % $    h  Parameter List.  Vz * %  *  %Argument   Bullet Symbolcti@ %  % @ %   % _  Computer %Emphasis  EquationVariables   Step Number  Subscript  Superscript % Variable _ Computer  %Emphasis @ % Variable  %Argument       S  @    Thin Medium  %Double Thick@  Very Thinuu    r Hp q p Hp q p Hp q p eHp q p Hp q p Format A   r Hp q p Hp q p Hp q p Hp q p Hp q p Format B !I Y J I Commentefgh ji@  d Black!T WhiteddA Reddd Greendd Blued Cyand Magentad YellowW.Palatino.R.700 Palatino-Bold W.Times.R.400 Times-Roman W.Palatino.R.400Palatino-RomanW.Palatino.I.400Palatino-ItalicW.Courier.R.400Courier W.Times.R.700 Times-BoldW.Courier.R.700 Courier-BoldW.Helvetica.R.700Helvetica-Bold7Courier  Helveticat%Palatino*Times Regular Regular BoldItalicRegularQdi:RW=Csu;%bX[2naHUz= :/*rki_LXXBXqpmi| Mc0%6w:Z) mJ< RWh%=r1