home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: regex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| HTML document text
| default (weak)
| |
98%
| file
| HTML document, ASCII text
| default (weak)
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| text/html
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3c 54 49 54 4c 45 3e 72 | 65 67 65 78 20 2d 2d 20 |<TITLE>r|egex -- |
|00000010| 50 79 74 68 6f 6e 20 6c | 69 62 72 61 72 79 20 72 |Python l|ibrary r|
|00000020| 65 66 65 72 65 6e 63 65 | 3c 2f 54 49 54 4c 45 3e |eference|</TITLE>|
|00000030| 0a 4e 65 78 74 3a 20 3c | 41 20 48 52 45 46 3d 22 |.Next: <|A HREF="|
|00000040| 2e 2e 2f 72 2f 72 65 67 | 73 75 62 22 20 54 59 50 |../r/reg|sub" TYP|
|00000050| 45 3d 22 4e 65 78 74 22 | 3e 72 65 67 73 75 62 3c |E="Next"|>regsub<|
|00000060| 2f 41 3e 20 20 0a 50 72 | 65 76 3a 20 3c 41 20 48 |/A> .Pr|ev: <A H|
|00000070| 52 45 46 3d 22 2e 2e 2f | 73 2f 73 74 72 69 6e 67 |REF="../|s/string|
|00000080| 22 20 54 59 50 45 3d 22 | 50 72 65 76 22 3e 73 74 |" TYPE="|Prev">st|
|00000090| 72 69 6e 67 3c 2f 41 3e | 20 20 0a 55 70 3a 20 3c |ring</A>| .Up: <|
|000000a0| 41 20 48 52 45 46 3d 22 | 2e 2e 2f 73 2f 73 74 72 |A HREF="|../s/str|
|000000b0| 69 6e 67 5f 73 65 72 76 | 69 63 65 73 22 20 54 59 |ing_serv|ices" TY|
|000000c0| 50 45 3d 22 55 70 22 3e | 53 74 72 69 6e 67 20 53 |PE="Up">|String S|
|000000d0| 65 72 76 69 63 65 73 3c | 2f 41 3e 20 20 0a 54 6f |ervices<|/A> .To|
|000000e0| 70 3a 20 3c 41 20 48 52 | 45 46 3d 22 2e 2e 2f 74 |p: <A HR|EF="../t|
|000000f0| 2f 74 6f 70 22 20 54 59 | 50 45 3d 22 54 6f 70 22 |/top" TY|PE="Top"|
|00000100| 3e 54 6f 70 3c 2f 41 3e | 20 20 0a 3c 48 31 3e 34 |>Top</A>| .<H1>4|
|00000110| 2e 32 2e 20 42 75 69 6c | 74 2d 69 6e 20 4d 6f 64 |.2. Buil|t-in Mod|
|00000120| 75 6c 65 20 3c 43 4f 44 | 45 3e 72 65 67 65 78 3c |ule <COD|E>regex<|
|00000130| 2f 43 4f 44 45 3e 3c 2f | 48 31 3e 0a 54 68 69 73 |/CODE></|H1>.This|
|00000140| 20 6d 6f 64 75 6c 65 20 | 70 72 6f 76 69 64 65 73 | module |provides|
|00000150| 20 72 65 67 75 6c 61 72 | 20 65 78 70 72 65 73 73 | regular| express|
|00000160| 69 6f 6e 20 6d 61 74 63 | 68 69 6e 67 20 6f 70 65 |ion matc|hing ope|
|00000170| 72 61 74 69 6f 6e 73 20 | 73 69 6d 69 6c 61 72 20 |rations |similar |
|00000180| 74 6f 0a 74 68 6f 73 65 | 20 66 6f 75 6e 64 20 69 |to.those| found i|
|00000190| 6e 20 45 6d 61 63 73 2e | 20 20 49 74 20 69 73 20 |n Emacs.| It is |
|000001a0| 61 6c 77 61 79 73 20 61 | 76 61 69 6c 61 62 6c 65 |always a|vailable|
|000001b0| 2e 0a 3c 50 3e 0a 42 79 | 20 64 65 66 61 75 6c 74 |..<P>.By| default|
|000001c0| 20 74 68 65 20 70 61 74 | 74 65 72 6e 73 20 61 72 | the pat|terns ar|
|000001d0| 65 20 45 6d 61 63 73 2d | 73 74 79 6c 65 20 72 65 |e Emacs-|style re|
|000001e0| 67 75 6c 61 72 20 65 78 | 70 72 65 73 73 69 6f 6e |gular ex|pression|
|000001f0| 73 0a 28 77 69 74 68 20 | 6f 6e 65 20 65 78 63 65 |s.(with |one exce|
|00000200| 70 74 69 6f 6e 29 2e 20 | 20 54 68 65 72 65 20 69 |ption). | There i|
|00000210| 73 0a 61 20 77 61 79 20 | 74 6f 20 63 68 61 6e 67 |s.a way |to chang|
|00000220| 65 20 74 68 65 20 73 79 | 6e 74 61 78 20 74 6f 20 |e the sy|ntax to |
|00000230| 6d 61 74 63 68 20 74 68 | 61 74 20 6f 66 20 73 65 |match th|at of se|
|00000240| 76 65 72 61 6c 20 77 65 | 6c 6c 2d 6b 6e 6f 77 6e |veral we|ll-known|
|00000250| 0a 55 4e 49 58 20 75 74 | 69 6c 69 74 69 65 73 2e |.UNIX ut|ilities.|
|00000260| 20 20 54 68 65 20 65 78 | 63 65 70 74 69 6f 6e 20 | The ex|ception |
|00000270| 69 73 20 74 68 61 74 20 | 45 6d 61 63 73 27 20 60 |is that |Emacs' `|
|00000280| 3c 53 41 4d 50 3e 5c 73 | 3c 2f 53 41 4d 50 3e 27 |<SAMP>\s|</SAMP>'|
|00000290| 0a 70 61 74 74 65 72 6e | 20 69 73 20 6e 6f 74 20 |.pattern| is not |
|000002a0| 73 75 70 70 6f 72 74 65 | 64 2c 20 73 69 6e 63 65 |supporte|d, since|
|000002b0| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 69 6d | the ori|ginal im|
|000002c0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 72 65 66 |plementa|tion ref|
|000002d0| 65 72 65 6e 63 65 73 0a | 74 68 65 20 45 6d 61 63 |erences.|the Emac|
|000002e0| 73 20 73 79 6e 74 61 78 | 20 74 61 62 6c 65 73 2e |s syntax| tables.|
|000002f0| 0a 3c 50 3e 0a 54 68 69 | 73 20 6d 6f 64 75 6c 65 |.<P>.Thi|s module|
|00000300| 20 69 73 20 38 2d 62 69 | 74 20 63 6c 65 61 6e 3a | is 8-bi|t clean:|
|00000310| 20 62 6f 74 68 20 70 61 | 74 74 65 72 6e 73 20 61 | both pa|tterns a|
|00000320| 6e 64 20 73 74 72 69 6e | 67 73 20 6d 61 79 20 63 |nd strin|gs may c|
|00000330| 6f 6e 74 61 69 6e 20 6e | 75 6c 6c 0a 62 79 74 65 |ontain n|ull.byte|
|00000340| 73 20 61 6e 64 20 63 68 | 61 72 61 63 74 65 72 73 |s and ch|aracters|
|00000350| 20 77 68 6f 73 65 20 68 | 69 67 68 20 62 69 74 20 | whose h|igh bit |
|00000360| 69 73 20 73 65 74 2e 0a | 3c 50 3e 0a 3c 42 3e 50 |is set..|<P>.<B>P|
|00000370| 6c 65 61 73 65 20 6e 6f | 74 65 3a 3c 2f 42 3e 20 |lease no|te:</B> |
|00000380| 54 68 65 72 65 20 69 73 | 20 61 20 6c 69 74 74 6c |There is| a littl|
|00000390| 65 2d 6b 6e 6f 77 6e 20 | 66 61 63 74 20 61 62 6f |e-known |fact abo|
|000003a0| 75 74 20 50 79 74 68 6f | 6e 20 73 74 72 69 6e 67 |ut Pytho|n string|
|000003b0| 0a 6c 69 74 65 72 61 6c | 73 20 77 68 69 63 68 20 |.literal|s which |
|000003c0| 6d 65 61 6e 73 20 74 68 | 61 74 20 79 6f 75 20 64 |means th|at you d|
|000003d0| 6f 6e 27 74 20 75 73 75 | 61 6c 6c 79 20 68 61 76 |on't usu|ally hav|
|000003e0| 65 20 74 6f 20 77 6f 72 | 72 79 20 61 62 6f 75 74 |e to wor|ry about|
|000003f0| 0a 64 6f 75 62 6c 69 6e | 67 20 62 61 63 6b 73 6c |.doublin|g backsl|
|00000400| 61 73 68 65 73 2c 20 65 | 76 65 6e 20 74 68 6f 75 |ashes, e|ven thou|
|00000410| 67 68 20 74 68 65 79 20 | 61 72 65 20 75 73 65 64 |gh they |are used|
|00000420| 20 74 6f 20 65 73 63 61 | 70 65 20 73 70 65 63 69 | to esca|pe speci|
|00000430| 61 6c 0a 63 68 61 72 61 | 63 74 65 72 73 20 69 6e |al.chara|cters in|
|00000440| 20 73 74 72 69 6e 67 20 | 6c 69 74 65 72 61 6c 73 | string |literals|
|00000450| 20 61 73 20 77 65 6c 6c | 20 61 73 20 69 6e 20 72 | as well| as in r|
|00000460| 65 67 75 6c 61 72 20 65 | 78 70 72 65 73 73 69 6f |egular e|xpressio|
|00000470| 6e 73 2e 20 20 54 68 69 | 73 0a 69 73 20 62 65 63 |ns. Thi|s.is bec|
|00000480| 61 75 73 65 20 50 79 74 | 68 6f 6e 20 64 6f 65 73 |ause Pyt|hon does|
|00000490| 6e 27 74 20 72 65 6d 6f | 76 65 20 62 61 63 6b 73 |n't remo|ve backs|
|000004a0| 6c 61 73 68 65 73 20 66 | 72 6f 6d 20 73 74 72 69 |lashes f|rom stri|
|000004b0| 6e 67 20 6c 69 74 65 72 | 61 6c 73 20 69 66 0a 74 |ng liter|als if.t|
|000004c0| 68 65 79 20 61 72 65 20 | 66 6f 6c 6c 6f 77 65 64 |hey are |followed|
|000004d0| 20 62 79 20 61 6e 20 75 | 6e 72 65 63 6f 67 6e 69 | by an u|nrecogni|
|000004e0| 7a 65 64 20 65 73 63 61 | 70 65 20 63 68 61 72 61 |zed esca|pe chara|
|000004f0| 63 74 65 72 2e 0a 3c 49 | 3e 48 6f 77 65 76 65 72 |cter..<I|>However|
|00000500| 3c 2f 49 3e 2c 20 69 66 | 20 79 6f 75 20 77 61 6e |</I>, if| you wan|
|00000510| 74 20 74 6f 20 69 6e 63 | 6c 75 64 65 20 61 20 6c |t to inc|lude a l|
|00000520| 69 74 65 72 61 6c 20 3c | 44 46 4e 3e 62 61 63 6b |iteral <|DFN>back|
|00000530| 73 6c 61 73 68 3c 2f 44 | 46 4e 3e 20 69 6e 20 61 |slash</D|FN> in a|
|00000540| 0a 72 65 67 75 6c 61 72 | 20 65 78 70 72 65 73 73 |.regular| express|
|00000550| 69 6f 6e 20 72 65 70 72 | 65 73 65 6e 74 65 64 20 |ion repr|esented |
|00000560| 61 73 20 61 20 73 74 72 | 69 6e 67 20 6c 69 74 65 |as a str|ing lite|
|00000570| 72 61 6c 2c 20 79 6f 75 | 20 68 61 76 65 20 74 6f |ral, you| have to|
|00000580| 0a 3c 49 3e 71 75 61 64 | 72 75 70 6c 65 3c 2f 49 |.<I>quad|ruple</I|
|00000590| 3e 20 69 74 2e 20 20 45 | 2e 67 2e 20 20 74 6f 20 |> it. E|.g. to |
|000005a0| 65 78 74 72 61 63 74 20 | 4c 61 54 65 58 20 60 3c |extract |LaTeX `<|
|000005b0| 53 41 4d 50 3e 5c 73 65 | 63 74 69 6f 6e 7b 3c 52 |SAMP>\se|ction{<R|
|000005c0| 3e 2e 2e 2e 3c 2f 52 3e | 7d 3c 2f 53 41 4d 50 3e |>...</R>|}</SAMP>|
|000005d0| 27 20 68 65 61 64 65 72 | 73 20 66 72 6f 6d 20 61 |' header|s from a|
|000005e0| 20 64 6f 63 75 6d 65 6e | 74 2c 20 79 6f 75 20 63 | documen|t, you c|
|000005f0| 61 6e 20 75 73 65 20 74 | 68 69 73 20 70 61 74 74 |an use t|his patt|
|00000600| 65 72 6e 3a 0a 3c 43 4f | 44 45 3e 27 5c 5c 5c 5c |ern:.<CO|DE>'\\\\|
|00000610| 73 65 63 74 69 6f 6e 7b | 5c 28 2e 2a 5c 29 7d 27 |section{|\(.*\)}'|
|00000620| 3c 2f 43 4f 44 45 3e 2e | 20 20 3c 49 3e 41 6e 6f |</CODE>.| <I>Ano|
|00000630| 74 68 65 72 20 65 78 63 | 65 70 74 69 6f 6e 3a 3c |ther exc|eption:<|
|00000640| 2f 49 3e 0a 74 68 65 20 | 65 73 63 61 70 65 20 73 |/I>.the |escape s|
|00000650| 65 71 75 65 63 65 20 60 | 3c 53 41 4d 50 3e 5c 62 |equece `|<SAMP>\b|
|00000660| 3c 2f 53 41 4d 50 3e 27 | 20 69 73 20 73 69 67 6e |</SAMP>'| is sign|
|00000670| 69 66 69 63 61 6e 74 20 | 69 6e 20 73 74 72 69 6e |ificant |in strin|
|00000680| 67 20 6c 69 74 65 72 61 | 6c 73 0a 28 77 68 65 72 |g litera|ls.(wher|
|00000690| 65 20 69 74 20 6d 65 61 | 6e 73 20 74 68 65 20 41 |e it mea|ns the A|
|000006a0| 53 43 49 49 20 62 65 6c | 6c 20 63 68 61 72 61 63 |SCII bel|l charac|
|000006b0| 74 65 72 29 20 61 73 20 | 77 65 6c 6c 20 61 73 20 |ter) as |well as |
|000006c0| 69 6e 20 45 6d 61 63 73 | 20 72 65 67 75 6c 61 72 |in Emacs| regular|
|000006d0| 0a 65 78 70 72 65 73 73 | 69 6f 6e 73 20 28 77 68 |.express|ions (wh|
|000006e0| 65 72 65 20 69 74 20 73 | 74 61 6e 64 73 20 66 6f |ere it s|tands fo|
|000006f0| 72 20 61 20 77 6f 72 64 | 20 62 6f 75 6e 64 61 72 |r a word| boundar|
|00000700| 79 29 2c 20 73 6f 20 69 | 6e 20 6f 72 64 65 72 20 |y), so i|n order |
|00000710| 74 6f 0a 73 65 61 72 63 | 68 20 66 6f 72 20 61 20 |to.searc|h for a |
|00000720| 77 6f 72 64 20 62 6f 75 | 6e 64 61 72 79 2c 20 79 |word bou|ndary, y|
|00000730| 6f 75 20 73 68 6f 75 6c | 64 20 75 73 65 20 74 68 |ou shoul|d use th|
|00000740| 65 20 70 61 74 74 65 72 | 6e 20 3c 43 4f 44 45 3e |e patter|n <CODE>|
|00000750| 27 5c 5c 62 27 3c 2f 43 | 4f 44 45 3e 2e 0a 53 69 |'\\b'</C|ODE>..Si|
|00000760| 6d 69 6c 61 72 6c 79 2c | 20 61 20 62 61 63 6b 73 |milarly,| a backs|
|00000770| 6c 61 73 68 20 66 6f 6c | 6c 6f 77 65 64 20 62 79 |lash fol|lowed by|
|00000780| 20 61 20 64 69 67 69 74 | 20 30 2d 37 20 73 68 6f | a digit| 0-7 sho|
|00000790| 75 6c 64 20 62 65 20 64 | 6f 75 62 6c 65 64 20 74 |uld be d|oubled t|
|000007a0| 6f 0a 61 76 6f 69 64 20 | 69 6e 74 65 72 70 72 65 |o.avoid |interpre|
|000007b0| 74 61 74 69 6f 6e 20 61 | 73 20 61 6e 20 6f 63 74 |tation a|s an oct|
|000007c0| 61 6c 20 65 73 63 61 70 | 65 2e 0a 3c 50 3e 0a 3c |al escap|e..<P>.<|
|000007d0| 48 32 3e 4d 65 6e 75 3c | 2f 48 32 3e 3c 44 4c 20 |H2>Menu<|/H2><DL |
|000007e0| 43 4f 4d 50 41 43 54 3e | 0a 3c 44 54 3e 3c 41 20 |COMPACT>|.<DT><A |
|000007f0| 48 52 45 46 3d 22 2e 2e | 2f 72 2f 72 65 67 75 6c |HREF="..|/r/regul|
|00000800| 61 72 5f 65 78 70 72 65 | 73 73 69 6f 6e 73 22 20 |ar_expre|ssions" |
|00000810| 54 59 50 45 3d 4d 65 6e | 75 3e 52 65 67 75 6c 61 |TYPE=Men|u>Regula|
|00000820| 72 20 45 78 70 72 65 73 | 73 69 6f 6e 73 3c 2f 41 |r Expres|sions</A|
|00000830| 3e 0a 3c 44 44 3e 3c 44 | 54 3e 3c 41 20 48 52 45 |>.<DD><D|T><A HRE|
|00000840| 46 3d 22 2e 2e 2f 6d 2f | 6d 6f 64 75 6c 65 5f 63 |F="../m/|module_c|
|00000850| 6f 6e 74 65 6e 74 73 22 | 20 54 59 50 45 3d 4d 65 |ontents"| TYPE=Me|
|00000860| 6e 75 3e 4d 6f 64 75 6c | 65 20 43 6f 6e 74 65 6e |nu>Modul|e Conten|
|00000870| 74 73 3c 2f 41 3e 0a 3c | 44 44 3e 3c 2f 44 4c 3e |ts</A>.<|DD></DL>|
|00000880| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+