home *** CD-ROM | disk | FTP | other *** search
/ Tools en Utilities / CDASS_5.ISO / shell / file / auror200.arj / REGEXP.DOX < prev    next >
Unknown  |  1995-01-26  |  12.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 0d 0a 0d 0a 20 20 52 65 | 67 75 6c 61 72 20 45 78 |.... Re|gular Ex|
|00000010| 70 72 65 73 73 69 6f 6e | 20 53 65 61 72 63 68 69 |pression| Searchi|
|00000020| 6e 67 00 0d 0a 20 20 c4 | c4 c4 c4 c4 c4 c4 c4 c4 |ng... .|........|
|00000030| c4 c4 c4 c4 c4 c4 c4 c4 | c4 c4 c4 c4 c4 c4 c4 c4 |........|........|
|00000040| c4 c4 c4 0d 0a 20 20 54 | 68 65 20 52 65 67 75 6c |..... T|he Regul|
|00000050| 61 72 20 45 78 70 72 65 | 73 73 69 6f 6e 20 73 65 |ar Expre|ssion se|
|00000060| 61 72 63 68 20 6f 70 74 | 69 6f 6e 20 27 78 27 20 |arch opt|ion 'x' |
|00000070| 61 6c 6c 6f 77 73 20 79 | 6f 75 20 74 6f 20 73 70 |allows y|ou to sp|
|00000080| 65 63 69 66 79 20 63 6f | 6d 70 6c 65 78 0d 0a 20 |ecify co|mplex.. |
|00000090| 20 73 65 61 72 63 68 20 | 70 61 74 74 65 72 6e 73 | search |patterns|
|000000a0| 20 77 68 65 6e 20 73 65 | 61 72 63 68 69 6e 67 20 | when se|arching |
|000000b0| 74 68 72 6f 75 67 68 20 | 62 75 66 66 65 72 73 20 |through |buffers |
|000000c0| 6f 72 20 73 74 72 69 6e | 67 73 2e 20 4f 70 74 69 |or strin|gs. Opti|
|000000d0| 6f 6e 20 27 78 27 0d 0a | 20 20 63 61 6e 20 62 65 |on 'x'..| can be|
|000000e0| 20 73 70 65 63 69 66 69 | 65 64 20 69 6e 20 62 6f | specifi|ed in bo|
|000000f0| 74 68 20 65 6e 64 2d 75 | 73 65 72 20 73 65 61 72 |th end-u|ser sear|
|00000100| 63 68 20 70 72 6f 6d 70 | 74 73 20 61 6e 64 20 6d |ch promp|ts and m|
|00000110| 61 63 72 6f 20 6c 61 6e | 67 75 61 67 65 0d 0a 20 |acro lan|guage.. |
|00000120| 20 73 65 61 72 63 68 69 | 6e 67 20 66 75 6e 63 74 | searchi|ng funct|
|00000130| 69 6f 6e 73 20 28 73 75 | 63 68 20 61 73 20 27 66 |ions (su|ch as 'f|
|00000140| 69 6e 64 27 20 61 6e 64 | 20 27 72 65 70 6c 61 63 |ind' and| 'replac|
|00000150| 65 27 29 2e 0d 0a 0d 0a | 20 20 52 65 67 75 6c 61 |e').....| Regula|
|00000160| 72 20 65 78 70 72 65 73 | 73 69 6f 6e 20 73 65 61 |r expres|sion sea|
|00000170| 72 63 68 20 70 61 74 74 | 65 72 6e 73 20 61 72 65 |rch patt|erns are|
|00000180| 20 63 72 65 61 74 65 64 | 20 62 79 20 63 6f 6d 62 | created| by comb|
|00000190| 69 6e 69 6e 67 20 6e 6f | 72 6d 61 6c 0d 0a 20 20 |ining no|rmal.. |
|000001a0| 63 68 61 72 61 63 74 65 | 72 73 20 77 69 74 68 20 |characte|rs with |
|000001b0| 72 65 67 75 6c 61 72 20 | 65 78 70 72 65 73 73 69 |regular |expressi|
|000001c0| 6f 6e 20 27 6f 70 65 72 | 61 74 6f 72 27 20 63 68 |on 'oper|ator' ch|
|000001d0| 61 72 61 63 74 65 72 73 | 20 69 6e 20 74 68 65 20 |aracters| in the |
|000001e0| 73 65 61 72 63 68 0d 0a | 20 20 73 74 72 69 6e 67 |search..| string|
|000001f0| 2e 20 54 68 65 73 65 20 | 6f 70 65 72 61 74 6f 72 |. These |operator|
|00000200| 73 20 74 61 6b 65 20 6f | 6e 20 61 20 73 70 65 63 |s take o|n a spec|
|00000210| 69 61 6c 20 6d 65 61 6e | 69 6e 67 20 77 68 65 6e |ial mean|ing when|
|00000220| 20 74 68 65 20 73 65 61 | 72 63 68 0d 0a 20 20 6f | the sea|rch.. o|
|00000230| 70 74 69 6f 6e 20 27 78 | 27 20 69 73 20 73 70 65 |ption 'x|' is spe|
|00000240| 63 69 66 69 65 64 2e 0d | 0a 0d 0a 20 20 45 61 63 |cified..|... Eac|
|00000250| 68 20 6f 70 65 72 61 74 | 6f 72 20 6d 61 74 63 68 |h operat|or match|
|00000260| 65 73 20 61 20 70 61 74 | 74 65 72 6e 2e 20 54 68 |es a pat|tern. Th|
|00000270| 65 72 65 20 61 72 65 20 | 6f 70 65 72 61 74 6f 72 |ere are |operator|
|00000280| 73 20 77 68 69 63 68 20 | 61 6c 6c 6f 77 20 79 6f |s which |allow yo|
|00000290| 75 0d 0a 20 20 74 6f 20 | 61 6e 63 68 6f 72 20 73 |u.. to |anchor s|
|000002a0| 65 61 72 63 68 65 73 20 | 74 6f 20 74 68 65 20 62 |earches |to the b|
|000002b0| 65 67 69 6e 6e 69 6e 67 | 20 6f 72 20 65 6e 64 20 |eginning| or end |
|000002c0| 6f 66 20 61 20 6c 69 6e | 65 2c 20 6d 61 74 63 68 |of a lin|e, match|
|000002d0| 20 61 6e 79 0d 0a 20 20 | 63 68 61 72 61 63 74 65 | any.. |characte|
|000002e0| 72 2c 20 6d 61 74 63 68 | 20 61 20 63 6c 61 73 73 |r, match| a class|
|000002f0| 20 6f 66 20 63 68 61 72 | 61 63 74 65 72 73 20 6f | of char|acters o|
|00000300| 72 20 69 74 73 20 63 6f | 6d 70 6c 65 6d 65 6e 74 |r its co|mplement|
|00000310| 2c 20 6f 70 74 69 6f 6e | 61 6c 6c 79 0d 0a 20 20 |, option|ally.. |
|00000320| 6d 61 74 63 68 20 61 20 | 70 61 74 74 65 72 6e 2c |match a |pattern,|
|00000330| 20 6d 61 74 63 68 20 6f | 6e 65 20 6f 66 20 73 65 | match o|ne of se|
|00000340| 76 65 72 61 6c 20 70 61 | 74 74 65 72 6e 73 2c 20 |veral pa|tterns, |
|00000350| 6d 61 74 63 68 20 72 65 | 70 65 61 74 69 6e 67 0d |match re|peating.|
|00000360| 0a 20 20 70 61 74 74 65 | 72 6e 73 2c 20 61 6e 64 |. patte|rns, and|
|00000370| 20 6d 61 74 63 68 20 67 | 72 6f 75 70 73 20 6f 66 | match g|roups of|
|00000380| 20 70 61 74 74 65 72 6e | 73 2e 0d 0a 0d 0a 20 20 | pattern|s..... |
|00000390| 41 20 72 69 63 68 20 73 | 65 74 20 6f 66 20 72 65 |A rich s|et of re|
|000003a0| 67 75 6c 61 72 20 65 78 | 70 72 65 73 73 69 6f 6e |gular ex|pression|
|000003b0| 20 6f 70 65 72 61 74 6f | 72 73 20 61 72 65 20 70 | operato|rs are p|
|000003c0| 72 6f 76 69 64 65 64 2e | 20 54 68 65 20 66 6f 6c |rovided.| The fol|
|000003d0| 6c 6f 77 69 6e 67 0d 0a | 20 20 74 61 62 6c 65 20 |lowing..| table |
|000003e0| 6c 69 73 74 73 20 61 6e | 64 20 64 65 73 63 72 69 |lists an|d descri|
|000003f0| 62 65 73 20 65 61 63 68 | 20 6f 66 20 74 68 65 20 |bes each| of the |
|00000400| 6f 70 65 72 61 74 6f 72 | 73 3a 0d 0a 0d 0a 0d 0a |operator|s:......|
|00000410| 20 20 4f 70 65 72 61 74 | 6f 72 20 20 44 65 73 63 | Operat|or Desc|
|00000420| 72 69 70 74 69 6f 6e 0d | 0a 20 20 c4 c4 c4 c4 c4 |ription.|. .....|
|00000430| c4 c4 c4 20 20 c4 c4 c4 | c4 c4 c4 c4 c4 c4 c4 c4 |... ...|........|
|00000440| 0d 0a 0d 0a 20 20 5e 20 | 20 20 20 20 20 20 20 20 |.... ^ | |
|00000450| 4d 61 74 63 68 65 73 20 | 74 68 65 20 62 65 67 69 |Matches |the begi|
|00000460| 6e 6e 69 6e 67 20 6f 66 | 20 61 20 6c 69 6e 65 2e |nning of| a line.|
|00000470| 20 49 66 20 74 68 65 20 | 73 65 61 72 63 68 20 69 | If the |search i|
|00000480| 73 20 63 6f 6e 66 69 6e | 65 64 0d 0a 20 20 20 20 |s confin|ed.. |
|00000490| 20 20 20 20 20 20 20 20 | 74 6f 20 61 20 6d 61 72 | |to a mar|
|000004a0| 6b 65 64 20 62 6c 6f 63 | 6b 20 77 69 74 68 20 73 |ked bloc|k with s|
|000004b0| 65 61 72 63 68 20 6f 70 | 74 69 6f 6e 20 27 62 27 |earch op|tion 'b'|
|000004c0| 2c 20 74 68 65 6e 20 74 | 68 69 73 20 6f 70 65 72 |, then t|his oper|
|000004d0| 61 74 6f 72 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ator.. | |
|000004e0| 20 20 6d 61 74 63 68 65 | 73 20 74 68 65 20 62 65 | matche|s the be|
|000004f0| 67 69 6e 6e 69 6e 67 20 | 63 6f 6c 75 6d 6e 20 6f |ginning |column o|
|00000500| 66 20 74 68 65 20 6d 61 | 72 6b 2e 20 46 6f 72 20 |f the ma|rk. For |
|00000510| 65 78 61 6d 70 6c 65 3a | 0d 0a 0d 0a 20 20 20 20 |example:|.... |
|00000520| 20 20 20 20 20 20 20 20 | 20 20 5e 20 20 20 20 20 | | ^ |
|00000530| 20 20 20 20 2f 2f 20 6d | 61 74 63 68 65 73 20 74 | // m|atches t|
|00000540| 68 65 20 62 65 67 69 6e | 6e 69 6e 67 20 6f 66 20 |he begin|ning of |
|00000550| 61 20 6c 69 6e 65 0d 0a | 20 20 20 20 20 20 20 20 |a line..| |
|00000560| 20 20 20 20 20 20 5e 61 | 20 20 20 20 20 20 20 20 | ^a| |
|00000570| 2f 2f 20 6d 61 74 63 68 | 65 73 20 27 61 27 20 61 |// match|es 'a' a|
|00000580| 74 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 20 |t the be|ginning |
|00000590| 6f 66 20 61 20 6c 69 6e | 65 0d 0a 20 20 20 20 20 |of a lin|e.. |
|000005a0| 20 20 20 20 20 20 20 20 | 20 5e 61 70 70 6c 65 73 | | ^apples|
|000005b0| 20 20 20 2f 2f 20 6d 61 | 74 63 68 65 73 20 27 61 | // ma|tches 'a|
|000005c0| 70 70 6c 65 73 27 20 61 | 74 20 74 68 65 20 62 65 |pples' a|t the be|
|000005d0| 67 69 6e 6e 69 6e 67 20 | 6f 66 20 61 20 6c 69 6e |ginning |of a lin|
|000005e0| 65 0d 0a 0d 0a 20 20 24 | 20 20 20 20 20 20 20 20 |e.... $| |
|000005f0| 20 4d 61 74 63 68 65 73 | 20 74 68 65 20 65 6e 64 | Matches| the end|
|00000600| 20 6f 66 20 61 20 6c 69 | 6e 65 2e 20 49 66 20 74 | of a li|ne. If t|
|00000610| 68 65 20 73 65 61 72 63 | 68 20 69 73 20 63 6f 6e |he searc|h is con|
|00000620| 66 69 6e 65 64 20 74 6f | 20 61 0d 0a 20 20 20 20 |fined to| a.. |
|00000630| 20 20 20 20 20 20 20 20 | 6d 61 72 6b 65 64 20 62 | |marked b|
|00000640| 6c 6f 63 6b 20 77 69 74 | 68 20 73 65 61 72 63 68 |lock wit|h search|
|00000650| 20 6f 70 74 69 6f 6e 20 | 27 62 27 2c 20 74 68 65 | option |'b', the|
|00000660| 6e 20 74 68 69 73 20 6f | 70 65 72 61 74 6f 72 0d |n this o|perator.|
|00000670| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 6d 61 74 |. | mat|
|00000680| 63 68 65 73 20 74 68 65 | 20 65 6e 64 69 6e 67 20 |ches the| ending |
|00000690| 63 6f 6c 75 6d 6e 20 6f | 66 20 74 68 65 20 6d 61 |column o|f the ma|
|000006a0| 72 6b 20 6f 72 20 6c 69 | 6e 65 2e 20 46 6f 72 20 |rk or li|ne. For |
|000006b0| 65 78 61 6d 70 6c 65 3a | 0d 0a 0d 0a 20 20 20 20 |example:|.... |
|000006c0| 20 20 20 20 20 20 20 20 | 20 20 24 20 20 20 20 20 | | $ |
|000006d0| 20 20 20 20 2f 2f 20 6d | 61 74 63 68 65 73 20 74 | // m|atches t|
|000006e0| 68 65 20 65 6e 64 20 6f | 66 20 61 20 6c 69 6e 65 |he end o|f a line|
|000006f0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00000700| 6f 24 20 20 20 20 20 20 | 20 20 2f 2f 20 6d 61 74 |o$ | // mat|
|00000710| 63 68 65 73 20 27 6f 27 | 20 61 74 20 74 68 65 20 |ches 'o'| at the |
|00000720| 65 6e 64 20 6f 66 20 61 | 20 6c 69 6e 65 0d 0a 20 |end of a| line.. |
|00000730| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6f 72 61 | | ora|
|00000740| 6e 67 65 73 24 20 20 2f | 2f 20 6d 61 74 63 68 65 |nges$ /|/ matche|
|00000750| 73 20 27 6f 72 61 6e 67 | 65 73 27 20 61 74 20 74 |s 'orang|es' at t|
|00000760| 68 65 20 65 6e 64 20 6f | 66 20 61 20 6c 69 6e 65 |he end o|f a line|
|00000770| 0d 0a 0d 0a 20 20 2e 20 | 20 20 20 20 20 20 20 20 |.... . | |
|00000780| 4d 61 74 63 68 65 73 20 | 61 6e 79 20 63 68 61 72 |Matches |any char|
|00000790| 61 63 74 65 72 2e 20 46 | 6f 72 20 65 78 61 6d 70 |acter. F|or examp|
|000007a0| 6c 65 3a 0d 0a 0d 0a 20 | 20 20 20 20 20 20 20 20 |le:.... | |
|000007b0| 20 20 20 20 20 2e 20 20 | 20 20 20 20 20 20 20 2f | . | /|
|000007c0| 2f 20 6d 61 74 63 68 65 | 73 20 61 6e 79 20 73 69 |/ matche|s any si|
|000007d0| 6e 67 6c 65 20 63 68 61 | 72 61 63 74 65 72 0d 0a |ngle cha|racter..|
|000007e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2e 2e | | ..|
|000007f0| 20 20 20 20 20 20 20 20 | 2f 2f 20 6d 61 74 63 68 | |// match|
|00000800| 65 73 20 61 6e 79 20 74 | 77 6f 20 63 6f 6e 73 65 |es any t|wo conse|
|00000810| 63 75 74 69 76 65 20 63 | 68 61 72 61 63 74 65 72 |cutive c|haracter|
|00000820| 73 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |s.. | |
|00000830| 20 74 2e 6f 20 20 20 20 | 20 20 20 2f 2f 20 6d 61 | t.o | // ma|
|00000840| 74 63 68 65 73 20 27 74 | 77 6f 27 20 6f 72 20 27 |tches 't|wo' or '|
|00000850| 74 6f 6f 27 2c 20 62 75 | 74 20 6e 6f 74 0d 0a 20 |too', bu|t not.. |
|00000860| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000870| 20 20 20 20 20 20 20 2f | 2f 20 20 20 27 74 6f 65 | /|/ 'toe|
|00000880| 27 20 6f 72 20 27 74 72 | 75 65 27 0d 0a 0d 0a 20 |' or 'tr|ue'.... |
|00000890| 20 5b 20 5d 20 20 20 20 | 20 20 20 53 70 65 63 69 | [ ] | Speci|
|000008a0| 66 69 65 73 20 61 20 27 | 63 6c 61 73 73 27 20 6f |fies a '|class' o|
|000008b0| 66 20 63 68 61 72 61 63 | 74 65 72 73 20 74 68 61 |f charac|ters tha|
|000008c0| 74 20 61 20 73 69 6e 67 | 6c 65 20 63 68 61 72 61 |t a sing|le chara|
|000008d0| 63 74 65 72 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |cter.. | |
|000008e0| 20 20 63 61 6e 20 6d 61 | 74 63 68 2e 20 46 6f 72 | can ma|tch. For|
|000008f0| 20 65 78 61 6d 70 6c 65 | 3a 0d 0a 0d 0a 20 20 20 | example|:.... |
|00000900| 20 20 20 20 20 20 20 20 | 20 20 20 5b 61 62 5d 20 | | [ab] |
|00000910| 20 20 20 20 20 2f 2f 20 | 6d 61 74 63 68 65 73 20 | // |matches |
|00000920| 27 61 27 20 6f 72 20 27 | 62 27 0d 0a 20 20 20 20 |'a' or '|b'.. |
|00000930| 20 20 20 20 20 20 20 20 | 20 20 5b 61 62 63 31 32 | | [abc12|
|00000940| 21 5d 20 20 2f 2f 20 6d | 61 74 63 68 65 73 20 27 |!] // m|atches '|
|00000950| 61 27 2c 20 27 62 27 2c | 20 27 63 27 2c 20 27 31 |a', 'b',| 'c', '1|
|00000960| 27 2c 20 27 32 27 2c 20 | 6f 72 20 27 21 27 0d 0a |', '2', |or '!'..|
|00000970| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 5b 41 | | [A|
|00000980| 61 5a 7a 5d 20 20 20 20 | 2f 2f 20 6d 61 74 63 68 |aZz] |// match|
|00000990| 65 73 20 27 41 27 2c 20 | 27 61 27 2c 20 27 5a 27 |es 'A', |'a', 'Z'|
|000009a0| 2c 20 6f 72 20 27 7a 27 | 0d 0a 0d 0a 20 20 20 20 |, or 'z'|.... |
|000009b0| 20 20 20 20 20 20 20 20 | 4e 6f 74 65 20 74 68 61 | |Note tha|
|000009c0| 74 20 74 68 65 20 63 68 | 61 72 61 63 74 65 72 20 |t the ch|aracter |
|000009d0| 63 6c 61 73 73 20 69 73 | 20 61 6c 77 61 79 73 20 |class is| always |
|000009e0| 63 61 73 65 2d 73 65 6e | 73 69 74 69 76 65 2c 20 |case-sen|sitive, |
|000009f0| 65 76 65 6e 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |even.. | |
|00000a00| 20 20 77 68 65 6e 20 74 | 68 65 20 27 69 67 6e 6f | when t|he 'igno|
|00000a10| 72 65 20 63 61 73 65 27 | 20 73 65 61 72 63 68 20 |re case'| search |
|00000a20| 6f 70 74 69 6f 6e 20 27 | 69 27 20 69 73 20 73 70 |option '|i' is sp|
|00000a30| 65 63 69 66 69 65 64 2e | 0d 0a 0d 0a 20 20 5b 20 |ecified.|.... [ |
|00000a40| 2d 20 5d 20 20 20 20 20 | 53 70 65 63 69 66 69 65 |- ] |Specifie|
|00000a50| 73 20 61 20 72 61 6e 67 | 65 20 6f 66 20 63 68 61 |s a rang|e of cha|
|00000a60| 72 61 63 74 65 72 73 20 | 74 6f 20 6d 61 74 63 68 |racters |to match|
|00000a70| 20 77 68 65 6e 20 75 73 | 65 64 20 62 65 74 77 65 | when us|ed betwe|
|00000a80| 65 6e 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |en.. | |
|00000a90| 63 68 61 72 61 63 74 65 | 72 73 20 69 6e 20 61 20 |characte|rs in a |
|00000aa0| 63 6c 61 73 73 2e 20 4e | 6f 74 65 20 74 68 61 74 |class. N|ote that|
|00000ab0| 20 27 2d 27 20 69 73 20 | 74 72 65 61 74 65 64 20 | '-' is |treated |
|00000ac0| 61 73 20 61 20 6e 6f 72 | 6d 61 6c 0d 0a 20 20 20 |as a nor|mal.. |
|00000ad0| 20 20 20 20 20 20 20 20 | 20 63 68 61 72 61 63 74 | | charact|
|00000ae0| 65 72 20 69 66 20 75 73 | 65 64 20 61 73 20 74 68 |er if us|ed as th|
|00000af0| 65 20 66 69 72 73 74 20 | 6f 72 20 6c 61 73 74 20 |e first |or last |
|00000b00| 63 68 61 72 61 63 74 65 | 72 20 6f 66 20 74 68 65 |characte|r of the|
|00000b10| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 63 6c |.. | cl|
|00000b20| 61 73 73 2c 20 6f 72 20 | 69 66 20 75 73 65 64 20 |ass, or |if used |
|00000b30| 6f 75 74 73 69 64 65 20 | 74 68 65 20 63 6c 61 73 |outside |the clas|
|00000b40| 73 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 3a 0d |s. For e|xample:.|
|00000b50| 0a 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|00000b60| 20 5b 61 2d 7a 5d 20 20 | 20 20 20 20 20 20 2f 2f | [a-z] | //|
|00000b70| 20 6d 61 74 63 68 65 73 | 20 63 68 61 72 61 63 74 | matches| charact|
|00000b80| 65 72 73 20 27 61 27 20 | 74 68 72 6f 75 67 68 20 |ers 'a' |through |
|00000b90| 27 7a 27 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |'z'.. | |
|00000ba0| 20 20 20 5b 2d 2b 30 2d | 39 5d 20 20 20 20 20 20 | [-+0-|9] |
|00000bb0| 2f 2f 20 6d 61 74 63 68 | 65 73 20 63 68 61 72 61 |// match|es chara|
|00000bc0| 63 74 65 72 73 20 27 30 | 27 20 74 68 72 6f 75 67 |cters '0|' throug|
|00000bd0| 68 20 27 30 27 20 61 6e | 64 0d 0a 20 20 20 20 20 |h '0' an|d.. |
|00000be0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000bf0| 20 20 20 20 20 20 2f 2f | 20 20 20 27 2d 27 20 61 | //| '-' a|
|00000c00| 6e 64 20 27 2b 27 0d 0a | 20 20 20 20 20 20 20 20 |nd '+'..| |
|00000c10| 20 20 20 20 20 20 5b 61 | 2d 7a 41 2d 5a 30 2d 39 | [a|-zA-Z0-9|
|00000c20| 5d 20 20 2f 2f 20 6d 61 | 74 63 68 65 73 20 61 6e |] // ma|tches an|
|00000c30| 79 20 61 6c 70 68 61 6e | 75 6d 65 72 69 63 20 63 |y alphan|umeric c|
|00000c40| 68 61 72 61 63 74 65 72 | 0d 0a 0d 0a 20 20 5b 7e |haracter|.... [~|
|00000c50| 20 5d 20 20 20 20 20 20 | 53 70 65 63 69 66 69 65 | ] |Specifie|
|00000c60| 73 20 74 68 65 20 63 6f | 6d 70 6c 65 6d 65 6e 74 |s the co|mplement|
|00000c70| 20 6f 66 20 61 20 63 68 | 61 72 61 63 74 65 72 20 | of a ch|aracter |
|00000c80| 63 6c 61 73 73 20 61 67 | 61 69 6e 73 74 20 77 68 |class ag|ainst wh|
|00000c90| 69 63 68 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ich.. | |
|00000ca0| 20 74 6f 20 6d 61 74 63 | 68 20 61 20 63 68 61 72 | to matc|h a char|
|00000cb0| 61 63 74 65 72 2e 20 54 | 68 65 20 27 7e 27 20 6f |acter. T|he '~' o|
|00000cc0| 70 65 72 61 74 6f 72 20 | 69 73 20 6f 6e 6c 79 20 |perator |is only |
|00000cd0| 6d 65 61 6e 69 6e 67 66 | 75 6c 0d 0a 20 20 20 20 |meaningf|ul.. |
|00000ce0| 20 20 20 20 20 20 20 20 | 77 68 65 6e 20 75 73 65 | |when use|
|00000cf0| 64 20 61 73 20 74 68 65 | 20 66 69 72 73 74 20 63 |d as the| first c|
|00000d00| 68 61 72 61 63 74 65 72 | 20 61 66 74 65 72 20 74 |haracter| after t|
|00000d10| 68 65 20 27 5b 27 20 62 | 72 61 63 6b 65 74 2c 0d |he '[' b|racket,.|
|00000d20| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 6f 74 68 |. | oth|
|00000d30| 65 72 77 69 73 65 20 69 | 74 20 69 73 20 74 72 65 |erwise i|t is tre|
|00000d40| 61 74 65 64 20 61 73 20 | 61 6e 79 20 6f 74 68 65 |ated as |any othe|
|00000d50| 72 20 6e 6f 72 6d 61 6c | 20 63 68 61 72 61 63 74 |r normal| charact|
|00000d60| 65 72 2e 20 46 6f 72 0d | 0a 20 20 20 20 20 20 20 |er. For.|. |
|00000d70| 20 20 20 20 20 65 78 61 | 6d 70 6c 65 3a 0d 0a 0d | exa|mple:...|
|00000d80| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 5b |. | [|
|00000d90| 7e 61 62 5d 20 20 20 20 | 20 20 20 20 2f 2f 20 6d |~ab] | // m|
|00000da0| 61 74 63 68 20 61 6e 79 | 20 63 68 61 72 61 63 74 |atch any| charact|
|00000db0| 65 72 73 20 6f 74 68 65 | 72 20 74 68 61 6e 20 27 |ers othe|r than '|
|00000dc0| 61 27 20 6f 72 20 27 62 | 27 0d 0a 20 20 20 20 20 |a' or 'b|'.. |
|00000dd0| 20 20 20 20 20 20 20 20 | 20 5b 7e 31 32 7e 5d 20 | | [~12~] |
|00000de0| 20 20 20 20 20 20 2f 2f | 20 6d 61 74 63 68 20 61 | //| match a|
|00000df0| 6e 79 20 63 68 61 72 61 | 63 74 65 72 73 20 6f 74 |ny chara|cters ot|
|00000e00| 68 65 72 20 74 68 61 6e | 0d 0a 20 20 20 20 20 20 |her than|.. |
|00000e10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000e20| 20 20 20 20 20 2f 2f 20 | 20 20 27 31 27 2c 20 27 | // | '1', '|
|00000e30| 32 27 2c 20 6f 72 20 27 | 7e 27 0d 0a 20 20 20 20 |2', or '|~'.. |
|00000e40| 20 20 20 20 20 20 20 20 | 20 20 5b 7e 30 2d 39 5d | | [~0-9]|
|00000e50| 20 20 20 20 20 20 20 2f | 2f 20 6d 61 74 63 68 20 | /|/ match |
|00000e60| 61 6e 79 20 6e 6f 6e 2d | 6e 75 6d 65 72 69 63 20 |any non-|numeric |
|00000e70| 63 68 61 72 61 63 74 65 | 72 0d 0a 0d 0a 20 20 3f |characte|r.... ?|
|00000e80| 20 20 20 20 20 20 20 20 | 20 4f 70 74 69 6f 6e 61 | | Optiona|
|00000e90| 6c 6c 79 20 6d 61 74 63 | 68 65 73 20 74 68 65 20 |lly matc|hes the |
|00000ea0| 70 72 65 63 65 64 69 6e | 67 20 70 61 74 74 65 72 |precedin|g patter|
|00000eb0| 6e 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 3a 0d |n. For e|xample:.|
|00000ec0| 0a 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|00000ed0| 20 74 68 65 73 3f 65 20 | 20 20 20 20 20 20 2f 2f | thes?e | //|
|00000ee0| 20 6d 61 74 63 68 65 73 | 20 27 74 68 65 65 27 20 | matches| 'thee' |
|00000ef0| 6f 72 20 27 74 68 65 73 | 65 27 0d 0a 20 20 20 20 |or 'thes|e'.. |
|00000f00| 20 20 20 20 20 20 20 20 | 20 20 74 68 65 5b 73 6d | | the[sm|
|00000f10| 5d 3f 65 20 20 20 20 2f | 2f 20 6d 61 74 63 68 65 |]?e /|/ matche|
|00000f20| 73 20 27 74 68 65 65 27 | 2c 20 27 74 68 65 73 65 |s 'thee'|, 'these|
|00000f30| 27 2c 20 6f 72 20 27 74 | 68 65 6d 65 27 0d 0a 0d |', or 't|heme'...|
|00000f40| 0a 20 20 7c 20 20 20 20 | 20 20 20 20 20 54 68 69 |. | | Thi|
|00000f50| 73 20 69 73 20 74 68 65 | 20 61 6c 74 65 72 6e 61 |s is the| alterna|
|00000f60| 74 69 6f 6e 20 28 27 6f | 72 27 29 20 6f 70 65 72 |tion ('o|r') oper|
|00000f70| 61 74 6f 72 2e 20 49 74 | 20 6d 61 74 63 68 65 73 |ator. It| matches|
|00000f80| 20 74 68 65 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | the.. | |
|00000f90| 20 20 70 72 65 63 65 64 | 69 6e 67 20 6f 72 20 74 | preced|ing or t|
|00000fa0| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 70 61 74 |he follo|wing pat|
|00000fb0| 74 65 72 6e 2e 20 46 6f | 72 20 65 78 61 6d 70 6c |tern. Fo|r exampl|
|00000fc0| 65 3a 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |e:.... | |
|00000fd0| 20 20 20 20 74 68 65 7c | 69 6e 20 20 20 20 20 20 | the||in |
|00000fe0| 20 2f 2f 20 6d 61 74 63 | 68 65 73 20 27 74 68 65 | // matc|hes 'the|
|00000ff0| 6e 27 20 6f 72 20 27 74 | 68 69 6e 27 0d 0a 20 20 |n' or 't|hin'.. |
|00001000| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001010| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 20 20 28 62 | | // (b|
|00001020| 75 74 20 6e 6f 74 20 27 | 74 68 65 27 20 6f 72 20 |ut not '|the' or |
|00001030| 27 69 6e 29 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |'in).. | |
|00001040| 20 20 20 20 74 68 65 73 | 7c 6d 65 20 20 20 20 20 | thes||me |
|00001050| 20 2f 2f 20 6d 61 74 63 | 68 65 73 20 27 74 68 65 | // matc|hes 'the|
|00001060| 73 65 27 20 6f 72 20 27 | 74 68 65 6d 65 27 0d 0a |se' or '|theme'..|
|00001070| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 4d 75 |.. | Mu|
|00001080| 6c 74 69 70 6c 65 20 27 | 7c 27 20 6f 70 65 72 61 |ltiple '||' opera|
|00001090| 74 6f 72 73 20 63 61 6e | 20 62 65 20 63 68 61 69 |tors can| be chai|
|000010a0| 6e 65 64 20 74 6f 67 65 | 74 68 65 72 2e 20 54 68 |ned toge|ther. Th|
|000010b0| 65 20 27 6f 72 2d 65 64 | 27 0d 0a 20 20 20 20 20 |e 'or-ed|'.. |
|000010c0| 20 20 20 20 20 20 20 70 | 61 74 74 65 72 6e 73 20 | p|atterns |
|000010d0| 61 72 65 20 73 65 61 72 | 63 68 65 64 20 69 6e 20 |are sear|ched in |
|000010e0| 74 68 65 20 6f 72 64 65 | 72 20 69 6e 20 77 68 69 |the orde|r in whi|
|000010f0| 63 68 20 74 68 65 79 20 | 61 72 65 20 6c 69 73 74 |ch they |are list|
|00001100| 65 64 2e 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ed... | |
|00001110| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 3a 0d 0a 0d | For exa|mple:...|
|00001120| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 74 |. | t|
|00001130| 68 65 73 7c 6d 7c 72 7c | 20 7c 65 0d 0a 20 20 20 |hes|m|r|| |e.. |
|00001140| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2f 20 | | // |
|00001150| 6d 61 74 63 68 65 73 20 | 27 74 68 65 73 65 27 2c |matches |'these',|
|00001160| 20 27 74 68 65 6d 65 27 | 2c 20 27 74 68 65 72 65 | 'theme'|, 'there|
|00001170| 27 2c 20 6f 72 20 27 74 | 68 65 20 65 27 0d 0a 20 |', or 't|he e'.. |
|00001180| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 7b 61 70 | | {ap|
|00001190| 70 6c 65 73 7d 7c 7b 6f | 72 61 6e 67 65 73 7d 7c |ples}|{o|ranges}||
|000011a0| 7b 62 61 6e 61 6e 61 73 | 7d 0d 0a 20 20 20 20 20 |{bananas|}.. |
|000011b0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 20 6d 61 | | // ma|
|000011c0| 74 63 68 65 73 20 27 61 | 70 70 6c 65 73 27 2c 20 |tches 'a|pples', |
|000011d0| 27 6f 72 61 6e 67 65 73 | 27 2c 20 6f 72 20 27 62 |'oranges|', or 'b|
|000011e0| 61 6e 61 6e 61 73 27 20 | 28 73 65 65 20 62 65 6c |ananas' |(see bel|
|000011f0| 6f 77 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ow.. | |
|00001200| 20 20 20 20 2f 2f 20 66 | 6f 72 20 61 20 64 65 73 | // f|or a des|
|00001210| 63 72 69 70 74 69 6f 6e | 20 74 68 65 20 67 72 6f |cription| the gro|
|00001220| 75 70 69 6e 67 20 6f 70 | 65 72 61 74 6f 72 20 27 |uping op|erator '|
|00001230| 7b 7d 27 29 0d 0a 0d 0a | 20 20 2a 20 20 20 20 20 |{}')....| * |
|00001240| 20 20 20 20 4d 61 74 63 | 68 65 73 20 7a 65 72 6f | Matc|hes zero|
|00001250| 20 6f 72 20 6d 6f 72 65 | 20 6f 63 63 75 72 72 65 | or more| occurre|
|00001260| 6e 63 65 73 20 6f 66 20 | 74 68 65 20 70 72 65 63 |nces of |the prec|
|00001270| 65 64 69 6e 67 20 70 61 | 74 74 65 72 6e 2c 0d 0a |eding pa|ttern,..|
|00001280| 20 20 20 20 20 20 20 20 | 20 20 20 20 6d 61 74 63 | | matc|
|00001290| 68 69 6e 67 20 61 73 20 | 66 65 77 20 6f 63 63 75 |hing as |few occu|
|000012a0| 72 72 65 6e 63 65 73 20 | 61 73 20 70 6f 73 73 69 |rrences |as possi|
|000012b0| 62 6c 65 20 28 6d 69 6e | 69 6d 75 6d 20 63 6c 6f |ble (min|imum clo|
|000012c0| 73 75 72 65 29 2e 0d 0a | 20 20 20 20 20 20 20 20 |sure)...| |
|000012d0| 20 20 20 20 46 6f 72 20 | 65 78 61 6d 70 6c 65 3a | For |example:|
|000012e0| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |.... | |
|000012f0| 20 20 66 6f 2a 62 61 72 | 0d 0a 20 20 20 20 20 20 | fo*bar|.. |
|00001300| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 6d 61 74 | | // mat|
|00001310| 63 68 65 73 20 27 66 62 | 61 72 27 2c 20 27 66 6f |ches 'fb|ar', 'fo|
|00001320| 62 61 72 27 2c 20 27 66 | 6f 6f 62 61 72 27 2c 20 |bar', 'f|oobar', |
|00001330| 27 66 6f 6f 6f 62 61 72 | 27 2c 20 65 74 63 2e 0d |'fooobar|', etc..|
|00001340| 0a 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|00001350| 20 61 70 70 6c 65 73 2e | 2a 6f 72 61 6e 67 65 73 | apples.|*oranges|
|00001360| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00001370| 20 20 2f 2f 20 6d 61 74 | 63 68 65 73 20 61 6e 79 | // mat|ches any|
|00001380| 20 73 74 72 69 6e 67 20 | 73 74 61 72 74 69 6e 67 | string |starting|
|00001390| 20 77 69 74 68 20 27 61 | 70 70 6c 65 73 27 20 61 | with 'a|pples' a|
|000013a0| 6e 64 20 65 6e 64 69 6e | 67 0d 0a 20 20 20 20 20 |nd endin|g.. |
|000013b0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 20 77 69 | | // wi|
|000013c0| 74 68 20 27 6f 72 61 6e | 67 65 73 27 3a 0d 0a 0d |th 'oran|ges':...|
|000013d0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 27 4d 69 |. | 'Mi|
|000013e0| 6e 69 6d 75 6d 20 63 6c | 6f 73 75 72 65 27 20 6d |nimum cl|osure' m|
|000013f0| 65 61 6e 73 20 74 68 61 | 74 20 74 68 65 20 73 68 |eans tha|t the sh|
|00001400| 6f 72 74 65 73 74 20 70 | 6f 73 73 69 62 6c 65 20 |ortest p|ossible |
|00001410| 73 74 72 69 6e 67 20 69 | 73 0d 0a 20 20 20 20 20 |string i|s.. |
|00001420| 20 20 20 20 20 20 20 6d | 61 74 63 68 65 64 2e 20 | m|atched. |
|00001430| 46 6f 72 20 65 78 61 6d | 70 6c 65 2c 20 69 66 20 |For exam|ple, if |
|00001440| 74 68 65 20 73 65 61 72 | 63 68 20 70 61 74 74 65 |the sear|ch patte|
|00001450| 72 6e 20 69 73 20 27 61 | 62 2a 62 27 20 61 6e 64 |rn is 'a|b*b' and|
|00001460| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 73 74 |.. | st|
|00001470| 72 69 6e 67 20 74 6f 20 | 62 65 20 73 65 61 72 63 |ring to |be searc|
|00001480| 68 65 64 20 69 73 20 27 | 61 62 62 62 62 62 62 62 |hed is '|abbbbbbb|
|00001490| 27 2c 20 74 68 65 6e 20 | 27 61 62 27 20 77 69 6c |', then |'ab' wil|
|000014a0| 6c 20 62 65 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |l be.. | |
|000014b0| 20 20 6d 61 74 63 68 65 | 64 2e 20 54 68 75 73 2c | matche|d. Thus,|
|000014c0| 20 74 68 65 20 27 2a 27 | 61 6e 64 20 27 2b 27 20 | the '*'|and '+' |
|000014d0| 6f 70 65 72 61 74 6f 72 | 73 20 61 72 65 20 73 65 |operator|s are se|
|000014e0| 6c 64 6f 6d 20 75 73 65 | 64 20 61 74 0d 0a 20 20 |ldom use|d at.. |
|000014f0| 20 20 20 20 20 20 20 20 | 20 20 74 68 65 20 65 6e | | the en|
|00001500| 64 20 6f 66 20 61 20 73 | 65 61 72 63 68 20 73 74 |d of a s|earch st|
|00001510| 72 69 6e 67 29 2e 0d 0a | 0d 0a 20 20 2b 20 20 20 |ring)...|.. + |
|00001520| 20 20 20 20 20 20 4d 61 | 74 63 68 65 73 20 6f 6e | Ma|tches on|
|00001530| 65 20 6f 72 20 6d 6f 72 | 65 20 6f 63 63 75 72 72 |e or mor|e occurr|
|00001540| 65 6e 63 65 73 20 6f 66 | 20 74 68 65 20 70 72 65 |ences of| the pre|
|00001550| 63 65 64 69 6e 67 20 70 | 61 74 74 65 72 6e 2c 0d |ceding p|attern,.|
|00001560| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 6d 61 74 |. | mat|
|00001570| 63 68 69 6e 67 20 61 73 | 20 66 65 77 20 6f 63 63 |ching as| few occ|
|00001580| 75 72 72 65 6e 63 65 73 | 20 61 73 20 70 6f 73 73 |urrences| as poss|
|00001590| 69 62 6c 65 20 28 6d 69 | 6e 69 6d 75 6d 20 63 6c |ible (mi|nimum cl|
|000015a0| 6f 73 75 72 65 29 2e 0d | 0a 20 20 20 20 20 20 20 |osure)..|. |
|000015b0| 20 20 20 20 20 46 6f 72 | 20 65 78 61 6d 70 6c 65 | For| example|
|000015c0| 3a 0d 0a 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |:.... | |
|000015d0| 20 20 20 66 6f 2b 62 61 | 72 0d 0a 20 20 20 20 20 | fo+ba|r.. |
|000015e0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 20 6d 61 | | // ma|
|000015f0| 74 63 68 65 73 20 27 66 | 6f 62 61 72 27 2c 20 27 |tches 'f|obar', '|
|00001600| 66 6f 6f 62 61 72 27 2c | 20 27 66 6f 6f 6f 62 61 |foobar',| 'foooba|
|00001610| 72 27 2c 20 65 74 63 2e | 0d 0a 20 20 20 20 20 20 |r', etc.|.. |
|00001620| 20 20 20 20 20 20 20 20 | 61 70 70 6c 65 73 20 2b | |apples +|
|00001630| 6f 72 61 6e 67 65 73 0d | 0a 20 20 20 20 20 20 20 |oranges.|. |
|00001640| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 6d 61 74 63 | | // matc|
|00001650| 68 65 73 20 61 6e 79 20 | 73 74 72 69 6e 67 20 73 |hes any |string s|
|00001660| 74 61 72 74 69 6e 67 20 | 77 69 74 68 20 27 61 70 |tarting |with 'ap|
|00001670| 70 6c 65 73 27 2c 20 66 | 6f 6c 6c 6f 77 65 64 0d |ples', f|ollowed.|
|00001680| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001690| 20 2f 2f 20 62 79 20 6f | 6e 65 20 6f 72 20 6d 6f | // by o|ne or mo|
|000016a0| 72 65 20 73 70 61 63 65 | 73 2c 20 61 6e 64 20 65 |re space|s, and e|
|000016b0| 6e 64 69 6e 67 20 77 69 | 74 68 20 27 6f 72 61 6e |nding wi|th 'oran|
|000016c0| 67 65 73 27 3a 0d 0a 0d | 0a 20 20 40 20 20 20 20 |ges':...|. @ |
|000016d0| 20 20 20 20 20 4d 61 74 | 63 68 65 73 20 7a 65 72 | Mat|ches zer|
|000016e0| 6f 20 6f 72 20 6d 6f 72 | 65 20 6f 63 63 75 72 72 |o or mor|e occurr|
|000016f0| 65 6e 63 65 73 20 6f 66 | 20 74 68 65 20 70 72 65 |ences of| the pre|
|00001700| 63 65 64 69 6e 67 20 70 | 61 74 74 65 72 6e 2c 0d |ceding p|attern,.|
|00001710| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 6d 61 74 |. | mat|
|00001720| 63 68 69 6e 67 20 61 73 | 20 6d 61 6e 79 20 6f 63 |ching as| many oc|
|00001730| 63 75 72 72 65 6e 63 65 | 73 20 61 73 20 70 6f 73 |currence|s as pos|
|00001740| 73 69 62 6c 65 20 28 6d | 61 78 69 6d 75 6d 20 63 |sible (m|aximum c|
|00001750| 6c 6f 73 75 72 65 29 2e | 0d 0a 20 20 20 20 20 20 |losure).|.. |
|00001760| 20 20 20 20 20 20 46 6f | 72 20 65 78 61 6d 70 6c | Fo|r exampl|
|00001770| 65 3a 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |e:.... | |
|00001780| 20 20 20 20 61 2e 40 7a | 0d 0a 20 20 20 20 20 20 | a.@z|.. |
|00001790| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 6d 61 74 | | // mat|
|000017a0| 63 68 65 73 20 61 20 73 | 74 72 69 6e 67 20 73 74 |ches a s|tring st|
|000017b0| 61 72 74 69 6e 67 20 77 | 69 74 68 20 27 61 27 20 |arting w|ith 'a' |
|000017c0| 61 6e 64 20 65 6e 64 69 | 6e 67 20 77 69 74 68 0d |and endi|ng with.|
|000017d0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000017e0| 20 2f 2f 20 27 7a 27 2c | 20 66 6f 72 20 74 68 65 | // 'z',| for the|
|000017f0| 20 6c 6f 6e 67 65 73 74 | 20 70 6f 73 73 69 62 6c | longest| possibl|
|00001800| 65 20 73 74 72 69 6e 67 | 0d 0a 20 20 20 20 20 20 |e string|.. |
|00001810| 20 20 20 20 20 20 20 20 | 27 2e 40 27 0d 0a 20 20 | |'.@'.. |
|00001820| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2f | | //|
|00001830| 20 6d 61 74 63 68 65 73 | 20 61 20 73 69 6e 67 6c | matches| a singl|
|00001840| 65 2d 71 75 6f 74 65 64 | 20 73 74 72 69 6e 67 20 |e-quoted| string |
|00001850| 66 6f 72 20 74 68 65 20 | 6c 6f 6e 67 65 73 74 0d |for the |longest.|
|00001860| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001870| 20 2f 2f 20 70 6f 73 73 | 69 62 6c 65 20 73 74 72 | // poss|ible str|
|00001880| 69 6e 67 0d 0a 0d 0a 20 | 20 20 20 20 20 20 20 20 |ing.... | |
|00001890| 20 20 20 27 4d 61 78 69 | 6d 75 6d 20 63 6c 6f 73 | 'Maxi|mum clos|
|000018a0| 75 72 65 27 20 6d 65 61 | 6e 73 20 74 68 61 74 20 |ure' mea|ns that |
|000018b0| 74 68 65 20 6c 6f 6e 67 | 65 73 74 20 70 6f 73 73 |the long|est poss|
|000018c0| 69 62 6c 65 20 73 74 72 | 69 6e 67 20 69 73 0d 0a |ible str|ing is..|
|000018d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 6d 61 74 63 | | matc|
|000018e0| 68 65 64 2e 20 46 6f 72 | 20 65 78 61 6d 70 6c 65 |hed. For| example|
|000018f0| 2c 20 69 66 20 74 68 65 | 20 73 65 61 72 63 68 20 |, if the| search |
|00001900| 70 61 74 74 65 72 6e 20 | 69 73 20 22 61 62 40 62 |pattern |is "ab@b|
|00001910| 22 2c 20 61 6e 64 0d 0a | 20 20 20 20 20 20 20 20 |", and..| |
|00001920| 20 20 20 20 74 68 65 20 | 73 74 72 69 6e 67 20 74 | the |string t|
|00001930| 6f 20 62 65 20 73 65 61 | 72 63 68 65 64 20 69 73 |o be sea|rched is|
|00001940| 20 27 61 62 62 62 62 62 | 62 62 27 2c 20 74 68 65 | 'abbbbb|bb', the|
|00001950| 6e 20 27 61 62 62 62 62 | 62 62 62 27 0d 0a 20 20 |n 'abbbb|bbb'.. |
|00001960| 20 20 20 20 20 20 20 20 | 20 20 77 69 6c 6c 20 62 | | will b|
|00001970| 65 20 6d 61 74 63 68 65 | 64 2e 0d 0a 0d 0a 20 20 |e matche|d..... |
|00001980| 23 20 20 20 20 20 20 20 | 20 20 4d 61 74 63 68 65 |# | Matche|
|00001990| 73 20 6f 6e 65 20 6f 72 | 20 6d 6f 72 65 20 6f 63 |s one or| more oc|
|000019a0| 63 75 72 72 65 6e 63 65 | 73 20 6f 66 20 74 68 65 |currence|s of the|
|000019b0| 20 70 72 65 63 65 64 69 | 6e 67 20 70 61 74 74 65 | precedi|ng patte|
|000019c0| 72 6e 2c 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |rn,.. | |
|000019d0| 20 6d 61 74 63 68 69 6e | 67 20 61 73 20 6d 61 6e | matchin|g as man|
|000019e0| 79 20 6f 63 63 75 72 72 | 65 6e 63 65 73 20 61 73 |y occurr|ences as|
|000019f0| 20 70 6f 73 73 69 62 6c | 65 20 28 6d 61 78 69 6d | possibl|e (maxim|
|00001a00| 75 6d 20 63 6c 6f 73 75 | 72 65 29 2e 0d 0a 20 20 |um closu|re)... |
|00001a10| 20 20 20 20 20 20 20 20 | 20 20 46 6f 72 20 65 78 | | For ex|
|00001a20| 61 6d 70 6c 65 3a 0d 0a | 0d 0a 20 20 20 20 20 20 |ample:..|.. |
|00001a30| 20 20 20 20 20 20 20 20 | 5b 61 2d 7a 41 2d 5a 5d | |[a-zA-Z]|
|00001a40| 23 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |#.. | |
|00001a50| 20 20 20 2f 2f 20 6d 61 | 74 63 68 65 73 20 74 68 | // ma|tches th|
|00001a60| 65 20 66 69 72 73 74 20 | 6f 63 63 75 72 72 65 6e |e first |occurren|
|00001a70| 63 65 20 6f 66 20 6f 6e | 65 20 6f 72 20 6d 6f 72 |ce of on|e or mor|
|00001a80| 65 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e.. | |
|00001a90| 20 20 20 2f 2f 20 61 6c | 70 68 61 62 65 74 69 63 | // al|phabetic|
|00001aa0| 20 63 68 61 72 61 63 74 | 65 72 73 2c 20 66 6f 72 | charact|ers, for|
|00001ab0| 20 74 68 65 20 6c 6f 6e | 67 65 73 74 20 73 74 72 | the lon|gest str|
|00001ac0| 69 6e 67 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ing.. | |
|00001ad0| 20 20 20 20 20 2f 2f 20 | 70 6f 73 73 69 62 6c 65 | // |possible|
|00001ae0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00001af0| 73 74 72 69 6e 67 32 23 | 0d 0a 20 20 20 20 20 20 |string2#|.. |
|00001b00| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 6d 61 74 | | // mat|
|00001b10| 63 68 65 73 20 27 73 74 | 72 69 6e 67 32 27 2c 20 |ches 'st|ring2', |
|00001b20| 27 73 74 72 69 6e 67 32 | 32 27 2c 20 27 73 74 72 |'string2|2', 'str|
|00001b30| 69 6e 67 32 32 32 27 2c | 20 65 74 63 2e 0d 0a 20 |ing222',| etc... |
|00001b40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00001b50| 2f 20 28 6d 61 74 63 68 | 69 6e 67 20 74 68 65 20 |/ (match|ing the |
|00001b60| 6c 6f 6e 67 65 73 74 20 | 70 6f 73 73 69 62 6c 65 |longest |possible|
|00001b70| 20 73 74 72 69 6e 67 29 | 0d 0a 0d 0a 20 20 7b 20 | string)|.... { |
|00001b80| 7d 20 20 20 20 20 20 20 | 47 72 6f 75 70 73 20 63 |} |Groups c|
|00001b90| 68 61 72 61 63 74 65 72 | 73 20 6f 72 20 6f 74 68 |haracter|s or oth|
|00001ba0| 65 72 20 70 61 74 74 65 | 72 6e 73 20 74 6f 67 65 |er patte|rns toge|
|00001bb0| 74 68 65 72 20 61 73 20 | 6f 6e 65 20 70 61 74 74 |ther as |one patt|
|00001bc0| 65 72 6e 2c 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ern,.. | |
|00001bd0| 20 20 73 6f 20 74 68 61 | 74 20 72 65 67 75 6c 61 | so tha|t regula|
|00001be0| 72 20 65 78 70 72 65 73 | 73 69 6f 6e 20 6f 70 65 |r expres|sion ope|
|00001bf0| 72 61 74 6f 72 73 20 63 | 61 6e 20 61 63 74 20 6f |rators c|an act o|
|00001c00| 6e 20 74 68 65 20 65 6e | 74 69 72 65 0d 0a 20 20 |n the en|tire.. |
|00001c10| 20 20 20 20 20 20 20 20 | 20 20 70 61 74 74 65 72 | | patter|
|00001c20| 6e 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 3a 0d |n. For e|xample:.|
|00001c30| 0a 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|00001c40| 20 7b 61 70 70 6c 65 73 | 7d 7c 7b 6f 72 61 6e 67 | {apples|}|{orang|
|00001c50| 65 73 7d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |es}.. | |
|00001c60| 20 20 20 20 20 2f 2f 20 | 6d 61 74 63 68 65 73 20 | // |matches |
|00001c70| 27 61 70 70 6c 65 73 27 | 20 6f 72 20 27 6f 72 61 |'apples'| or 'ora|
|00001c80| 6e 67 65 73 27 0d 0a 20 | 20 20 20 20 20 20 20 20 |nges'.. | |
|00001c90| 20 20 20 20 20 61 6e 6f | 74 68 65 72 7b 20 66 69 | ano|ther{ fi|
|00001ca0| 6e 65 7d 3f 20 6d 65 73 | 73 0d 0a 20 20 20 20 20 |ne}? mes|s.. |
|00001cb0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 20 6d 61 | | // ma|
|00001cc0| 74 63 68 65 73 20 27 61 | 6e 6f 74 68 65 72 20 6d |tches 'a|nother m|
|00001cd0| 65 73 73 27 20 6f 72 20 | 27 61 6e 6f 74 68 65 72 |ess' or |'another|
|00001ce0| 20 66 69 6e 65 20 6d 65 | 73 73 27 0d 0a 20 20 20 | fine me|ss'.. |
|00001cf0| 20 20 20 20 20 20 20 20 | 20 20 20 7b 61 62 7d 23 | | {ab}#|
|00001d00| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00001d10| 20 20 2f 2f 20 6d 61 74 | 63 68 65 73 20 27 61 62 | // mat|ches 'ab|
|00001d20| 27 2c 20 27 61 62 61 62 | 27 2c 20 27 61 62 61 62 |', 'abab|', 'abab|
|00001d30| 61 62 27 2c 20 65 74 63 | 2e 0d 0a 20 20 20 20 20 |ab', etc|... |
|00001d40| 20 20 20 20 20 20 20 20 | 20 7b 7b 61 62 7d 7c 7b | | {{ab}|{|
|00001d50| 78 79 7d 7d 23 0d 0a 20 | 20 20 20 20 20 20 20 20 |xy}}#.. | |
|00001d60| 20 20 20 20 20 20 20 2f | 2f 20 6d 61 74 63 68 65 | /|/ matche|
|00001d70| 73 20 27 61 62 27 2c 20 | 27 78 79 27 2c 20 27 61 |s 'ab', |'xy', 'a|
|00001d80| 62 61 62 27 2c 20 27 61 | 62 78 79 27 2c 20 27 78 |bab', 'a|bxy', 'x|
|00001d90| 79 61 62 27 2c 20 27 61 | 62 78 79 61 62 27 2c 0d |yab', 'a|bxyab',.|
|00001da0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001db0| 20 2f 2f 20 65 74 63 2e | 0d 0a 0d 0a 20 20 20 20 | // etc.|.... |
|00001dc0| 20 20 20 20 20 20 20 20 | 54 68 65 20 27 7b 7d 27 | |The '{}'|
|00001dd0| 20 6f 70 65 72 61 74 6f | 72 20 61 6c 73 6f 20 69 | operato|r also i|
|00001de0| 64 65 6e 74 69 66 69 65 | 73 20 6f 72 20 27 74 61 |dentifie|s or 'ta|
|00001df0| 67 73 27 20 70 61 74 74 | 65 72 6e 73 20 66 6f 72 |gs' patt|erns for|
|00001e00| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 72 65 |.. | re|
|00001e10| 70 6c 61 63 65 6d 65 6e | 74 20 28 73 65 65 20 62 |placemen|t (see b|
|00001e20| 65 6c 6f 77 29 2e 0d 0a | 0d 0a 20 20 5c 20 20 20 |elow)...|.. \ |
|00001e30| 20 20 20 20 20 20 49 6e | 64 69 63 61 74 65 73 20 | In|dicates |
|00001e40| 74 68 61 74 20 74 68 65 | 20 6e 65 78 74 20 63 68 |that the| next ch|
|00001e50| 61 72 61 63 74 65 72 20 | 69 73 20 74 6f 20 74 61 |aracter |is to ta|
|00001e60| 6b 65 6e 20 6c 69 74 65 | 72 61 6c 6c 79 20 61 6e |ken lite|rally an|
|00001e70| 64 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 6e |d.. | n|
|00001e80| 6f 74 20 75 73 65 64 20 | 61 73 20 61 20 72 65 67 |ot used |as a reg|
|00001e90| 75 6c 61 72 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |ular exp|ression |
|00001ea0| 6f 70 65 72 61 74 6f 72 | 2e 20 46 6f 72 20 65 78 |operator|. For ex|
|00001eb0| 61 6d 70 6c 65 3a 0d 0a | 0d 0a 20 20 20 20 20 20 |ample:..|.. |
|00001ec0| 20 20 20 20 20 20 20 20 | 61 70 70 6c 65 73 5c 2b | |apples\+|
|00001ed0| 2b 6f 72 61 6e 67 65 73 | 0d 0a 20 20 20 20 20 20 |+oranges|.. |
|00001ee0| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 6d 61 74 | | // mat|
|00001ef0| 63 68 65 73 20 27 61 70 | 70 6c 65 73 2b 6f 72 61 |ches 'ap|ples+ora|
|00001f00| 6e 67 65 73 27 2c 20 27 | 61 70 70 6c 65 73 2b 2b |nges', '|apples++|
|00001f10| 6f 72 61 6e 67 65 73 27 | 2c 20 65 74 63 2e 0d 0a |oranges'|, etc...|
|00001f20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 77 68 | | wh|
|00001f30| 61 74 73 20 61 6c 6c 20 | 74 68 69 73 20 74 68 65 |ats all |this the|
|00001f40| 6e 5c 3f 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |n\?.. | |
|00001f50| 20 20 20 20 20 2f 2f 20 | 6d 61 74 63 68 65 73 20 | // |matches |
|00001f60| 22 77 68 61 74 27 73 20 | 61 6c 6c 20 74 68 69 73 |"what's |all this|
|00001f70| 20 74 68 65 6e 3f 22 0d | 0a 20 20 20 20 20 20 20 | then?".|. |
|00001f80| 20 20 20 20 20 20 20 63 | 3a 5c 5c 66 69 6c 65 5c | c|:\\file\|
|00001f90| 2e 3f 74 78 74 0d 0a 20 | 20 20 20 20 20 20 20 20 |.?txt.. | |
|00001fa0| 20 20 20 20 20 20 20 2f | 2f 20 6d 61 74 63 68 65 | /|/ matche|
|00001fb0| 73 20 27 63 3a 5c 66 69 | 6c 65 74 78 74 27 20 6f |s 'c:\fi|letxt' o|
|00001fc0| 72 20 27 63 3a 5c 66 69 | 6c 65 2e 74 78 74 27 0d |r 'c:\fi|le.txt'.|
|00001fd0| 0a 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 54 |... | T|
|00001fe0| 68 65 20 27 5c 27 20 6f | 70 65 72 61 74 6f 72 20 |he '\' o|perator |
|00001ff0| 63 61 6e 20 61 6c 73 6f | 20 62 65 20 75 73 65 64 |can also| be used|
|00002000| 20 74 6f 20 6d 61 74 63 | 68 20 73 70 65 63 69 66 | to matc|h specif|
|00002010| 69 63 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ic.. | |
|00002020| 63 68 61 72 61 63 74 65 | 72 73 3a 0d 0a 0d 0a 20 |characte|rs:.... |
|00002030| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 5c 61 20 | | \a |
|00002040| 20 20 20 6d 61 74 63 68 | 65 73 20 74 68 65 20 61 | match|es the a|
|00002050| 6c 65 72 74 20 28 62 65 | 65 70 29 20 63 68 61 72 |lert (be|ep) char|
|00002060| 61 63 74 65 72 20 28 61 | 73 63 69 69 20 37 29 0d |acter (a|scii 7).|
|00002070| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 5c |. | \|
|00002080| 62 20 20 20 20 6d 61 74 | 63 68 65 73 20 74 68 65 |b mat|ches the|
|00002090| 20 62 61 63 6b 73 70 61 | 63 65 20 63 68 61 72 61 | backspa|ce chara|
|000020a0| 63 74 65 72 20 28 61 73 | 63 69 69 20 38 29 0d 0a |cter (as|cii 8)..|
|000020b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 5c 66 | | \f|
|000020c0| 20 20 20 20 6d 61 74 63 | 68 65 73 20 74 68 65 20 | matc|hes the |
|000020d0| 66 6f 72 6d 66 65 65 64 | 20 63 68 61 72 61 63 74 |formfeed| charact|
|000020e0| 65 72 20 28 61 73 63 69 | 69 20 31 32 29 0d 0a 20 |er (asci|i 12).. |
|000020f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 5c 6e 20 | | \n |
|00002100| 20 20 20 6d 61 74 63 68 | 65 73 20 74 68 65 20 6e | match|es the n|
|00002110| 65 77 6c 69 6e 65 20 28 | 6c 69 6e 65 66 65 65 64 |ewline (|linefeed|
|00002120| 29 20 63 68 61 72 61 63 | 74 65 72 20 28 61 73 63 |) charac|ter (asc|
|00002130| 69 69 20 31 30 29 0d 0a | 20 20 20 20 20 20 20 20 |ii 10)..| |
|00002140| 20 20 20 20 20 20 5c 72 | 20 20 20 20 6d 61 74 63 | \r| matc|
|00002150| 68 65 73 20 74 68 65 20 | 72 65 74 75 72 6e 20 63 |hes the |return c|
|00002160| 68 61 72 61 63 74 65 72 | 20 28 61 73 63 69 69 20 |haracter| (ascii |
|00002170| 31 33 29 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |13).. | |
|00002180| 20 20 20 5c 74 20 20 20 | 20 6d 61 74 63 68 65 73 | \t | matches|
|00002190| 20 74 68 65 20 74 61 62 | 20 63 68 61 72 61 63 74 | the tab| charact|
|000021a0| 65 72 20 28 61 73 63 69 | 69 20 39 29 0d 0a 20 20 |er (asci|i 9).. |
|000021b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 5c 76 20 20 | | \v |
|000021c0| 20 20 6d 61 74 63 68 65 | 73 20 74 68 65 20 76 65 | matche|s the ve|
|000021d0| 72 74 69 63 61 6c 20 74 | 61 62 20 63 68 61 72 61 |rtical t|ab chara|
|000021e0| 63 74 65 72 20 28 61 73 | 63 69 69 20 31 31 29 0d |cter (as|cii 11).|
|000021f0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 5c |. | \|
|00002200| 78 48 48 20 20 6d 61 74 | 63 68 65 73 20 74 68 65 |xHH mat|ches the|
|00002210| 20 68 65 78 61 64 65 63 | 69 6d 61 6c 20 63 68 61 | hexadec|imal cha|
|00002220| 72 61 63 74 65 72 20 27 | 48 48 27 0d 0a 0d 0a 20 |racter '|HH'.... |
|00002230| 20 20 20 20 20 20 20 20 | 20 20 20 46 6f 72 20 65 | | For e|
|00002240| 78 61 6d 70 6c 65 3a 0d | 0a 0d 0a 20 20 20 20 20 |xample:.|... |
|00002250| 20 20 20 20 20 20 20 20 | 20 5c 74 5c 74 0d 0a 20 | | \t\t.. |
|00002260| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00002270| 2f 20 6d 61 74 63 68 65 | 73 20 74 77 6f 20 74 61 |/ matche|s two ta|
|00002280| 62 20 63 68 61 72 61 63 | 74 65 72 73 0d 0a 20 20 |b charac|ters.. |
|00002290| 20 20 20 20 20 20 20 20 | 20 20 20 20 5c 78 30 30 | | \x00|
|000022a0| 7c 5c 72 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 ||\r.. | |
|000022b0| 20 20 20 20 20 2f 2f 20 | 6d 61 74 63 68 65 73 20 | // |matches |
|000022c0| 61 20 62 69 6e 61 72 79 | 20 7a 65 72 6f 20 6f 72 |a binary| zero or|
|000022d0| 20 61 20 72 65 74 75 72 | 6e 20 63 68 61 72 61 63 | a retur|n charac|
|000022e0| 74 65 72 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ter.. | |
|000022f0| 20 20 20 20 20 2f 2f 20 | 28 61 73 63 69 69 20 31 | // |(ascii 1|
|00002300| 33 29 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |3).... | |
|00002310| 20 20 54 68 65 20 27 5c | 27 20 6f 70 65 72 61 74 | The '\|' operat|
|00002320| 6f 72 20 69 73 20 61 6c | 73 6f 20 75 73 65 64 20 |or is al|so used |
|00002330| 77 69 74 68 69 6e 20 61 | 20 72 65 70 6c 61 63 65 |within a| replace|
|00002340| 6d 65 6e 74 20 70 61 74 | 74 65 72 6e 0d 0a 20 20 |ment pat|tern.. |
|00002350| 20 20 20 20 20 20 20 20 | 20 20 74 6f 20 72 65 66 | | to ref|
|00002360| 65 72 65 6e 63 65 20 61 | 20 70 61 74 74 65 72 6e |erence a| pattern|
|00002370| 20 77 68 69 63 68 20 77 | 61 73 20 74 61 67 67 65 | which w|as tagge|
|00002380| 64 20 77 69 74 68 20 74 | 68 65 20 67 72 6f 75 70 |d with t|he group|
|00002390| 69 6e 67 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ing.. | |
|000023a0| 20 27 7b 7d 27 20 6f 70 | 65 72 61 74 6f 72 20 28 | '{}' op|erator (|
|000023b0| 73 65 65 20 62 65 6c 6f | 77 29 2e 0d 0a 0d 0a 0d |see belo|w)......|
|000023c0| 0a 20 20 54 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |. The f|ollowing|
|000023d0| 20 61 72 65 20 61 20 66 | 65 77 20 61 64 64 69 74 | are a f|ew addit|
|000023e0| 69 6f 6e 61 6c 20 65 78 | 61 6d 70 6c 65 73 20 6f |ional ex|amples o|
|000023f0| 66 20 72 65 67 75 6c 61 | 72 20 65 78 70 72 65 73 |f regula|r expres|
|00002400| 73 69 6f 6e 0d 0a 20 20 | 73 65 61 72 63 68 20 70 |sion.. |search p|
|00002410| 61 74 74 65 72 6e 73 3a | 0d 0a 0d 0a 20 20 20 20 |atterns:|.... |
|00002420| 5e 24 20 20 20 20 20 20 | 2f 2f 20 6d 61 74 63 68 |^$ |// match|
|00002430| 65 73 20 62 6c 61 6e 6b | 20 6c 69 6e 65 73 0d 0a |es blank| lines..|
|00002440| 20 20 20 20 5e 2e 2a 24 | 20 20 20 20 2f 2f 20 6d | ^.*$| // m|
|00002450| 61 74 63 68 65 73 20 61 | 6c 6c 20 74 68 65 20 63 |atches a|ll the c|
|00002460| 68 61 72 61 63 74 65 72 | 73 20 6f 6e 20 61 6e 79 |haracter|s on any|
|00002470| 20 6c 69 6e 65 0d 0a 20 | 20 20 20 5e 2e 2b 24 20 | line.. | ^.+$ |
|00002480| 20 20 20 2f 2f 20 6d 61 | 74 63 68 65 73 20 61 6c | // ma|tches al|
|00002490| 6c 20 74 68 65 20 63 68 | 61 72 61 63 74 65 72 73 |l the ch|aracters|
|000024a0| 20 6f 6e 20 61 6e 79 20 | 6e 6f 6e 2d 62 6c 61 6e | on any |non-blan|
|000024b0| 6b 20 6c 69 6e 65 0d 0a | 0d 0a 20 20 20 20 7b 69 |k line..|.. {i|
|000024c0| 66 7d 7c 7b 65 6c 73 65 | 7d 7c 7b 66 6f 72 7d 7c |f}|{else|}|{for}||
|000024d0| 7b 77 68 69 6c 65 7d 7c | 7b 73 77 69 74 63 68 7d |{while}||{switch}|
|000024e0| 7c 7b 72 65 74 75 72 6e | 7d 7c 7b 62 72 65 61 6b ||{return|}|{break|
|000024f0| 7d 0d 0a 20 20 20 20 20 | 20 2f 2f 20 6d 61 74 63 |}.. | // matc|
|00002500| 68 65 73 20 61 20 66 65 | 77 20 27 43 27 20 6c 61 |hes a fe|w 'C' la|
|00002510| 6e 67 75 61 67 65 20 6b | 65 79 77 6f 72 64 73 0d |nguage k|eywords.|
|00002520| 0a 0d 0a 20 20 20 20 5b | 61 2d 7a 41 2d 5a 30 2d |... [|a-zA-Z0-|
|00002530| 39 5f 5d 23 0d 0a 20 20 | 20 20 20 20 2f 2f 20 6d |9_]#.. | // m|
|00002540| 61 74 63 68 65 73 20 69 | 64 65 6e 74 69 66 69 65 |atches i|dentifie|
|00002550| 72 73 20 69 6e 20 6d 6f | 73 74 20 6c 61 6e 67 75 |rs in mo|st langu|
|00002560| 61 67 65 73 0d 0a 0d 0a | 20 20 20 20 5e 20 2a 7b |ages....| ^ *{|
|00002570| 66 75 6e 63 74 69 6f 6e | 7d 7c 7b 6b 65 79 7d 2e |function|}|{key}.|
|00002580| 2a 24 0d 0a 20 20 20 20 | 20 20 2f 2f 20 6d 61 74 |*$.. | // mat|
|00002590| 63 68 65 73 20 41 4d 4c | 20 66 75 6e 63 74 69 6f |ches AML| functio|
|000025a0| 6e 20 68 65 61 64 65 72 | 73 0d 0a 0d 0a 20 20 20 |n header|s.... |
|000025b0| 20 5b 61 2d 7a 41 2d 5a | 30 2d 39 5f 5d 23 20 2a | [a-zA-Z|0-9_]# *|
|000025c0| 3d 20 2a 5b 30 2d 39 5d | 23 0d 0a 20 20 20 20 20 |= *[0-9]|#.. |
|000025d0| 20 2f 2f 20 6d 61 74 63 | 68 65 73 20 73 74 61 74 | // matc|hes stat|
|000025e0| 65 6d 65 6e 74 73 20 6f | 66 20 74 68 65 20 66 6f |ements o|f the fo|
|000025f0| 72 6d 3a 20 76 61 72 69 | 61 62 6c 65 20 3d 20 6e |rm: vari|able = n|
|00002600| 75 6d 62 65 72 0d 0a 0d | 0a 0d 0a 20 20 52 65 67 |umber...|... Reg|
|00002610| 75 6c 61 72 20 45 78 70 | 72 65 73 73 69 6f 6e 20 |ular Exp|ression |
|00002620| 52 65 70 6c 61 63 65 6d | 65 6e 74 20 50 61 74 74 |Replacem|ent Patt|
|00002630| 65 72 6e 73 0d 0a 20 20 | c4 c4 c4 c4 c4 c4 c4 c4 |erns.. |........|
|00002640| c4 c4 c4 c4 c4 c4 c4 c4 | c4 c4 c4 c4 c4 c4 c4 c4 |........|........|
|00002650| c4 c4 c4 c4 c4 c4 c4 c4 | c4 c4 c4 c4 c4 c4 c4 0d |........|........|
|00002660| 0a 20 20 41 20 70 61 74 | 74 65 72 6e 20 77 68 69 |. A pat|tern whi|
|00002670| 63 68 20 77 61 73 20 27 | 74 61 67 67 65 64 27 20 |ch was '|tagged' |
|00002680| 62 79 20 74 68 65 20 67 | 72 6f 75 70 69 6e 67 20 |by the g|rouping |
|00002690| 6f 70 65 72 61 74 6f 72 | 20 27 7b 7d 27 20 69 6e |operator| '{}' in|
|000026a0| 20 74 68 65 0d 0a 20 20 | 73 65 61 72 63 68 20 73 | the.. |search s|
|000026b0| 74 72 69 6e 67 20 6f 66 | 20 61 20 72 65 67 75 6c |tring of| a regul|
|000026c0| 61 72 20 65 78 70 72 65 | 73 73 69 6f 6e 20 73 65 |ar expre|ssion se|
|000026d0| 61 72 63 68 2d 61 6e 64 | 2d 72 65 70 6c 61 63 65 |arch-and|-replace|
|000026e0| 20 6f 70 65 72 61 74 69 | 6f 6e 20 63 61 6e 0d 0a | operati|on can..|
|000026f0| 20 20 62 65 20 72 65 66 | 65 72 65 6e 63 65 64 20 | be ref|erenced |
|00002700| 69 6e 20 74 68 65 20 72 | 65 70 6c 61 63 65 6d 65 |in the r|eplaceme|
|00002710| 6e 74 20 73 74 72 69 6e | 67 20 62 79 20 75 73 69 |nt strin|g by usi|
|00002720| 6e 67 20 74 68 65 20 27 | 5c 27 20 72 65 70 6c 61 |ng the '|\' repla|
|00002730| 63 65 6d 65 6e 74 0d 0a | 20 20 6f 70 65 72 61 74 |cement..| operat|
|00002740| 6f 72 2e 20 54 61 67 67 | 65 64 20 70 61 74 74 65 |or. Tagg|ed patte|
|00002750| 72 6e 73 20 61 72 65 20 | 6e 75 6d 62 65 72 65 64 |rns are |numbered|
|00002760| 20 66 72 6f 6d 20 31 20 | 74 6f 20 39 20 62 61 73 | from 1 |to 9 bas|
|00002770| 65 64 20 6f 6e 20 74 68 | 65 0d 0a 20 20 6c 65 66 |ed on th|e.. lef|
|00002780| 74 6d 6f 73 74 20 27 7b | 27 20 73 79 6d 62 6f 6c |tmost '{|' symbol|
|00002790| 20 69 6e 20 74 68 65 20 | 73 65 61 72 63 68 20 73 | in the |search s|
|000027a0| 74 72 69 6e 67 2e 20 54 | 68 65 20 70 61 74 74 65 |tring. T|he patte|
|000027b0| 72 6e 20 6e 75 6d 62 65 | 72 20 69 73 0d 0a 20 20 |rn numbe|r is.. |
|000027c0| 73 70 65 63 69 66 69 65 | 64 20 61 66 74 65 72 20 |specifie|d after |
|000027d0| 74 68 65 20 27 5c 27 20 | 63 68 61 72 61 63 74 65 |the '\' |characte|
|000027e0| 72 20 69 6e 20 74 68 65 | 20 72 65 70 6c 61 63 65 |r in the| replace|
|000027f0| 6d 65 6e 74 20 73 74 72 | 69 6e 67 2e 20 46 6f 72 |ment str|ing. For|
|00002800| 0d 0a 20 20 65 78 61 6d | 70 6c 65 3a 0d 0a 0d 0a |.. exam|ple:....|
|00002810| 20 20 20 20 73 65 61 72 | 63 68 20 73 74 72 69 6e | sear|ch strin|
|00002820| 67 3a 20 20 20 20 22 7b | 2e 2a 7d 22 20 20 20 20 |g: "{|.*}" |
|00002830| 20 20 20 20 20 2f 2f 20 | 63 68 61 6e 67 65 73 20 | // |changes |
|00002840| 64 6f 75 62 6c 65 2d 71 | 75 6f 74 65 64 20 73 74 |double-q|uoted st|
|00002850| 72 69 6e 67 73 0d 0a 20 | 20 20 20 72 65 70 6c 61 |rings.. | repla|
|00002860| 63 65 20 73 74 72 69 6e | 67 3a 20 20 20 27 5c 31 |ce strin|g: '\1|
|00002870| 27 20 20 20 20 20 20 20 | 20 20 20 20 2f 2f 20 74 |' | // t|
|00002880| 6f 20 73 69 6e 67 6c 65 | 2d 71 75 6f 74 65 64 20 |o single|-quoted |
|00002890| 73 74 72 69 6e 67 73 0d | 0a 0d 0a 20 20 20 20 73 |strings.|... s|
|000028a0| 65 61 72 63 68 20 73 74 | 72 69 6e 67 3a 20 20 20 |earch st|ring: |
|000028b0| 20 7b 5b 61 2d 7a 41 2d | 5a 5d 23 7d 20 2b 7b 5b | {[a-zA-|Z]#} +{[|
|000028c0| 61 2d 7a 41 2d 5a 5d 23 | 7d 0d 0a 20 20 20 20 72 |a-zA-Z]#|}.. r|
|000028d0| 65 70 6c 61 63 65 20 73 | 74 72 69 6e 67 3a 20 20 |eplace s|tring: |
|000028e0| 20 5c 32 20 61 6e 64 20 | 5c 31 0d 0a 0d 0a 20 20 | \2 and |\1.... |
|000028f0| 54 68 65 20 65 78 61 6d | 70 6c 65 20 61 62 6f 76 |The exam|ple abov|
|00002900| 65 20 72 65 76 65 72 73 | 65 73 20 74 77 6f 20 61 |e revers|es two a|
|00002910| 64 6a 61 63 65 6e 74 20 | 61 6c 70 68 61 62 65 74 |djacent |alphabet|
|00002920| 69 63 20 77 6f 72 64 73 | 20 61 6e 64 20 70 6c 61 |ic words| and pla|
|00002930| 63 65 73 0d 0a 20 20 74 | 68 65 20 77 6f 72 64 20 |ces.. t|he word |
|00002940| 27 61 6e 64 27 20 62 65 | 74 77 65 65 6e 20 74 68 |'and' be|tween th|
|00002950| 65 6d 2e 0d 0a 0d 0a 0d | 0a 20 20 53 70 65 63 69 |em......|. Speci|
|00002960| 66 79 69 6e 67 20 27 5c | 30 27 20 69 6e 20 74 68 |fying '\|0' in th|
|00002970| 65 20 72 65 70 6c 61 63 | 65 6d 65 6e 74 20 73 74 |e replac|ement st|
|00002980| 72 69 6e 67 20 72 65 66 | 65 72 65 6e 63 65 73 20 |ring ref|erences |
|00002990| 74 68 65 20 65 6e 74 69 | 72 65 20 73 65 61 72 63 |the enti|re searc|
|000029a0| 68 0d 0a 20 20 70 61 74 | 74 65 72 6e 2e 20 46 6f |h.. pat|tern. Fo|
|000029b0| 72 20 65 78 61 6d 70 6c | 65 3a 0d 0a 0d 0a 20 20 |r exampl|e:.... |
|000029c0| 20 20 73 65 61 72 63 68 | 20 73 74 72 69 6e 67 3a | search| string:|
|000029d0| 20 20 20 20 5e 2e 2b 24 | 20 20 20 20 20 20 20 20 | ^.+$| |
|000029e0| 20 20 20 2f 2f 20 65 6e | 63 6c 6f 73 65 73 20 6e | // en|closes n|
|000029f0| 6f 6e 2d 62 6c 61 6e 6b | 20 6c 69 6e 65 73 0d 0a |on-blank| lines..|
|00002a00| 20 20 20 20 72 65 70 6c | 61 63 65 20 73 74 72 69 | repl|ace stri|
|00002a10| 6e 67 3a 20 20 20 28 5c | 30 29 20 20 20 20 20 20 |ng: (\|0) |
|00002a20| 20 20 20 20 20 2f 2f 20 | 69 6e 20 70 61 72 65 6e | // |in paren|
|00002a30| 74 68 65 73 65 73 0d 0a | 0d 0a 20 20 20 20 73 65 |theses..|.. se|
|00002a40| 61 72 63 68 20 73 74 72 | 69 6e 67 3a 20 20 20 20 |arch str|ing: |
|00002a50| 5b 61 2d 7a 41 2d 5a 30 | 2d 39 5d 23 20 20 20 2f |[a-zA-Z0|-9]# /|
|00002a60| 2f 20 64 75 70 6c 69 63 | 61 74 65 73 20 61 6c 70 |/ duplic|ates alp|
|00002a70| 68 61 6e 75 6d 65 72 69 | 63 0d 0a 20 20 20 20 72 |hanumeri|c.. r|
|00002a80| 65 70 6c 61 63 65 20 73 | 74 72 69 6e 67 3a 20 20 |eplace s|tring: |
|00002a90| 20 5c 30 5c 30 20 20 20 | 20 20 20 20 20 20 20 20 | \0\0 | |
|00002aa0| 2f 2f 20 69 64 65 6e 74 | 69 66 69 65 72 73 0d 0a |// ident|ifiers..|
|00002ab0| 0d 0a 0d 0a 20 20 54 6f | 20 65 6e 74 65 72 20 74 |.... To| enter t|
|00002ac0| 68 65 20 27 5c 27 20 63 | 68 61 72 61 63 74 65 72 |he '\' c|haracter|
|00002ad0| 20 69 6e 20 61 20 72 65 | 70 6c 61 63 65 6d 65 6e | in a re|placemen|
|00002ae0| 74 20 73 74 72 69 6e 67 | 2c 20 65 6e 74 65 72 20 |t string|, enter |
|00002af0| 69 74 20 74 77 69 63 65 | 2e 0d 0a 20 20 46 6f 72 |it twice|... For|
|00002b00| 20 65 78 61 6d 70 6c 65 | 3a 0d 0a 0d 0a 20 20 20 | example|:.... |
|00002b10| 20 73 65 61 72 63 68 20 | 73 74 72 69 6e 67 3a 20 | search |string: |
|00002b20| 20 20 20 5e 20 20 20 20 | 20 20 20 20 20 20 20 20 | ^ | |
|00002b30| 20 20 2f 2f 20 69 6e 73 | 65 72 74 20 27 5c 5c 27 | // ins|ert '\\'|
|00002b40| 20 61 74 20 74 68 65 20 | 62 65 67 69 6e 6e 69 6e | at the |beginnin|
|00002b50| 67 0d 0a 20 20 20 20 72 | 65 70 6c 61 63 65 20 73 |g.. r|eplace s|
|00002b60| 74 72 69 6e 67 3a 20 20 | 20 5c 5c 5c 5c 20 20 20 |tring: | \\\\ |
|00002b70| 20 20 20 20 20 20 20 20 | 2f 2f 20 6f 72 20 65 61 | |// or ea|
|00002b80| 63 68 20 6c 69 6e 65 0d | 0a 0d 0a 0d 0a 0d 0a 20 |ch line.|....... |
|00002b90| 20 53 75 6d 6d 61 72 79 | 20 6f 66 20 52 65 67 75 | Summary| of Regu|
|00002ba0| 6c 61 72 20 45 78 70 72 | 65 73 73 69 6f 6e 20 4f |lar Expr|ession O|
|00002bb0| 70 65 72 61 74 6f 72 73 | 0d 0a 20 20 c4 c4 c4 c4 |perators|.. ....|
|00002bc0| c4 c4 c4 c4 c4 c4 c4 c4 | c4 c4 c4 c4 c4 c4 c4 c4 |........|........|
|00002bd0| c4 c4 c4 c4 c4 c4 c4 c4 | c4 c4 c4 c4 c4 c4 c4 c4 |........|........|
|00002be0| c4 c4 c4 0d 0a 0d 0a 20 | 20 4f 70 65 72 61 74 6f |....... | Operato|
|00002bf0| 72 20 20 44 65 73 63 72 | 69 70 74 69 6f 6e 0d 0a |r Descr|iption..|
|00002c00| 20 20 c4 c4 c4 c4 c4 c4 | c4 c4 20 20 c4 c4 c4 c4 | ......|.. ....|
|00002c10| c4 c4 c4 c4 c4 c4 c4 0d | 0a 20 20 5e 20 20 20 20 |........|. ^ |
|00002c20| 20 20 20 20 20 6d 61 74 | 63 68 20 74 68 65 20 62 | mat|ch the b|
|00002c30| 65 67 69 6e 6e 69 6e 67 | 20 6f 66 20 61 20 6c 69 |eginning| of a li|
|00002c40| 6e 65 0d 0a 20 20 24 20 | 20 20 20 20 20 20 20 20 |ne.. $ | |
|00002c50| 6d 61 74 63 68 20 74 68 | 65 20 65 6e 64 20 6f 66 |match th|e end of|
|00002c60| 20 61 20 6c 69 6e 65 0d | 0a 20 20 2e 20 20 20 20 | a line.|. . |
|00002c70| 20 20 20 20 20 6d 61 74 | 63 68 20 61 6e 79 20 63 | mat|ch any c|
|00002c80| 68 61 72 61 63 74 65 72 | 0d 0a 20 20 5b 20 5d 20 |haracter|.. [ ] |
|00002c90| 20 20 20 20 20 20 73 70 | 65 63 69 66 79 20 61 20 | sp|ecify a |
|00002ca0| 63 68 61 72 61 63 74 65 | 72 73 20 63 6c 61 73 73 |characte|rs class|
|00002cb0| 0d 0a 20 20 5b 20 2d 20 | 5d 20 20 20 20 20 73 70 |.. [ - |] sp|
|00002cc0| 65 63 69 66 79 20 61 20 | 72 61 6e 67 65 20 6f 66 |ecify a |range of|
|00002cd0| 20 63 68 61 72 61 63 74 | 65 72 73 0d 0a 20 20 5b | charact|ers.. [|
|00002ce0| 7e 20 5d 20 20 20 20 20 | 20 73 70 65 63 69 66 79 |~ ] | specify|
|00002cf0| 20 74 68 65 20 63 6f 6d | 70 6c 65 6d 65 6e 74 20 | the com|plement |
|00002d00| 6f 66 20 61 20 63 68 61 | 72 61 63 74 65 72 20 63 |of a cha|racter c|
|00002d10| 6c 61 73 73 0d 0a 20 20 | 3f 20 20 20 20 20 20 20 |lass.. |? |
|00002d20| 20 20 6f 70 74 69 6f 6e | 61 6c 6c 79 20 6d 61 74 | option|ally mat|
|00002d30| 63 68 20 74 68 65 20 70 | 72 65 63 65 64 69 6e 67 |ch the p|receding|
|00002d40| 20 70 61 74 74 65 72 6e | 0d 0a 20 20 7c 20 20 20 | pattern|.. | |
|00002d50| 20 20 20 20 20 20 74 68 | 65 20 61 6c 74 65 72 6e | th|e altern|
|00002d60| 61 74 69 6f 6e 20 28 27 | 6f 72 27 29 20 6f 70 65 |ation ('|or') ope|
|00002d70| 72 61 74 6f 72 0d 0a 20 | 20 2a 20 20 20 20 20 20 |rator.. | * |
|00002d80| 20 20 20 6d 61 74 63 68 | 20 7a 65 72 6f 20 6f 72 | match| zero or|
|00002d90| 20 6d 6f 72 65 20 6f 66 | 20 74 68 65 20 70 72 65 | more of| the pre|
|00002da0| 63 65 64 69 6e 67 20 70 | 61 74 74 65 72 6e 20 28 |ceding p|attern (|
|00002db0| 6d 69 6e 20 63 6c 6f 73 | 75 72 65 29 0d 0a 20 20 |min clos|ure).. |
|00002dc0| 2b 20 20 20 20 20 20 20 | 20 20 6d 61 74 63 68 20 |+ | match |
|00002dd0| 6f 6e 65 20 6f 72 20 6d | 6f 72 65 20 6f 66 20 74 |one or m|ore of t|
|00002de0| 68 65 20 70 72 65 63 65 | 64 69 6e 67 20 70 61 74 |he prece|ding pat|
|00002df0| 74 65 72 6e 20 28 6d 69 | 6e 20 63 6c 6f 73 75 72 |tern (mi|n closur|
|00002e00| 65 29 0d 0a 20 20 40 20 | 20 20 20 20 20 20 20 20 |e).. @ | |
|00002e10| 6d 61 74 63 68 20 7a 65 | 72 6f 20 6f 72 20 6d 6f |match ze|ro or mo|
|00002e20| 72 65 20 6f 66 20 74 68 | 65 20 70 72 65 63 65 64 |re of th|e preced|
|00002e30| 69 6e 67 20 70 61 74 74 | 65 72 6e 20 28 6d 61 78 |ing patt|ern (max|
|00002e40| 20 63 6c 6f 73 75 72 65 | 29 0d 0a 20 20 23 20 20 | closure|).. # |
|00002e50| 20 20 20 20 20 20 20 6d | 61 74 63 68 20 6f 6e 65 | m|atch one|
|00002e60| 20 6f 72 20 6d 6f 72 65 | 20 6f 66 20 74 68 65 20 | or more| of the |
|00002e70| 70 72 65 63 65 64 69 6e | 67 20 70 61 74 74 65 72 |precedin|g patter|
|00002e80| 6e 20 28 6d 61 78 20 63 | 6c 6f 73 75 72 65 29 0d |n (max c|losure).|
|00002e90| 0a 20 20 7b 20 7d 20 20 | 20 20 20 20 20 64 65 66 |. { } | def|
|00002ea0| 69 6e 65 20 61 20 67 72 | 6f 75 70 20 6f 72 20 74 |ine a gr|oup or t|
|00002eb0| 61 67 20 61 20 70 61 74 | 74 65 72 6e 0d 0a 20 20 |ag a pat|tern.. |
|00002ec0| 5c 20 20 20 20 20 20 20 | 20 20 6c 69 74 65 72 61 |\ | litera|
|00002ed0| 6c 20 6f 70 65 72 61 74 | 6f 72 2c 20 6f 72 20 72 |l operat|or, or r|
|00002ee0| 65 66 65 72 65 6e 63 65 | 20 61 20 74 61 67 67 65 |eference| a tagge|
|00002ef0| 64 20 70 61 74 74 65 72 | 6e 0d 0a 20 20 5c 61 20 |d patter|n.. \a |
|00002f00| 20 20 20 20 20 20 20 6d | 61 74 63 68 20 74 68 65 | m|atch the|
|00002f10| 20 61 6c 65 72 74 20 6f | 72 20 62 65 65 70 20 63 | alert o|r beep c|
|00002f20| 68 61 72 61 63 74 65 72 | 20 28 61 73 63 69 69 20 |haracter| (ascii |
|00002f30| 37 29 0d 0a 20 20 5c 62 | 20 20 20 20 20 20 20 20 |7).. \b| |
|00002f40| 6d 61 74 63 68 20 74 68 | 65 20 62 61 63 6b 73 70 |match th|e backsp|
|00002f50| 61 63 65 20 63 68 61 72 | 61 63 74 65 72 20 28 61 |ace char|acter (a|
|00002f60| 73 63 69 69 20 38 29 0d | 0a 20 20 5c 66 20 20 20 |scii 8).|. \f |
|00002f70| 20 20 20 20 20 6d 61 74 | 63 68 20 74 68 65 20 66 | mat|ch the f|
|00002f80| 6f 72 6d 66 65 65 64 20 | 63 68 61 72 61 63 74 65 |ormfeed |characte|
|00002f90| 72 20 28 61 73 63 69 69 | 20 31 32 29 0d 0a 20 20 |r (ascii| 12).. |
|00002fa0| 5c 6e 20 20 20 20 20 20 | 20 20 6d 61 74 63 68 20 |\n | match |
|00002fb0| 74 68 65 20 6e 65 77 6c | 69 6e 65 20 6f 72 20 6c |the newl|ine or l|
|00002fc0| 69 6e 65 66 65 65 64 20 | 63 68 61 72 61 63 74 65 |inefeed |characte|
|00002fd0| 72 20 28 61 73 63 69 69 | 20 31 30 29 0d 0a 20 20 |r (ascii| 10).. |
|00002fe0| 5c 72 20 20 20 20 20 20 | 20 20 6d 61 74 63 68 20 |\r | match |
|00002ff0| 74 68 65 20 72 65 74 75 | 72 6e 20 63 68 61 72 61 |the retu|rn chara|
|00003000| 63 74 65 72 20 28 61 73 | 63 69 69 20 31 33 29 0d |cter (as|cii 13).|
|00003010| 0a 20 20 5c 74 20 20 20 | 20 20 20 20 20 6d 61 74 |. \t | mat|
|00003020| 63 68 20 74 68 65 20 74 | 61 62 20 63 68 61 72 61 |ch the t|ab chara|
|00003030| 63 74 65 72 20 28 61 73 | 63 69 69 20 39 29 0d 0a |cter (as|cii 9)..|
|00003040| 20 20 5c 76 20 20 20 20 | 20 20 20 20 6d 61 74 63 | \v | matc|
|00003050| 68 20 74 68 65 20 76 65 | 72 74 69 63 61 6c 20 74 |h the ve|rtical t|
|00003060| 61 62 20 63 68 61 72 61 | 63 74 65 72 20 28 61 73 |ab chara|cter (as|
|00003070| 63 69 69 20 31 31 29 0d | 0a 20 20 5c 78 48 48 20 |cii 11).|. \xHH |
|00003080| 20 20 20 20 20 6d 61 74 | 63 68 20 74 68 65 20 68 | mat|ch the h|
|00003090| 65 78 61 64 65 63 69 6d | 61 6c 20 63 68 61 72 61 |exadecim|al chara|
|000030a0| 63 74 65 72 20 27 48 48 | 27 0d 0a 0d 0a |cter 'HH|'.... |
+--------+-------------------------+-------------------------+--------+--------+