Caml1999I037GH #Str®exp4;@@@A@@@@@5otherlibs/str/str.mliZ##Z#.@@@@ @@A@®exp5@&stringQ@@@[@@@\@@]@^bb^b@@!A@@0regexp_case_fold6@@@@^@@@_@@`@(NZZ)NZ@@3B@@%quote7@'@@@a+@@@b@@c@;S**<S*F@@FC@@-regexp_string8@:@@@d8@@@e@@f@MWNW@@XD@@7regexp_string_case_fold9@L@@@gJ@@@h@@i@_[00`[0^@@jE@@,string_match:@X@@@j@c@@@k@#intA@@@l$boolE@@@m@@n@@o@@p@c  c <@@F@@.search_forward;@z@@@q@@@@r@"@@@s&@@@t@@u@@v@@w@hh8@@G@@/search_backward<@@@@x@@@@y@@@@@zD@@@{@@|@@}@@~@pyypy@@H@@4string_partial_match=@@@@@@@@@^@@@\@@@@@@@@@@x  x C@@I@@.matched_string>@@@@@@@@@@}}@@J@@/match_beginning?@$unitF@@@@@@@@@@@K@@)match_end@@@@@@@@@@@@@!L@@-matched_groupA@@@@@@@@@@@@@@@@/0@@:M@@/group_beginningB@@@@@@@@@@BC@@MN@@)group_endC@@@@@@@@@@U  V  @@`O@@.global_replaceD@N@@@@Y@@@@_@@@c@@@@@@@@@@s""t"#@@~P@@-replace_firstE@l@@@@w@@@@}@@@@@@@@@@@@@$$$$@@Q@@1global_substituteF@@@@@@@@@@@@@@@@@@@@@@@@@@@@%k%k%k%@@R@@0substitute_firstG@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&'1@@S@@/replace_matchedH@@@@@@@@@@@@@@@@''''@@T@@%splitI@@@@@@@@$listK@@@@@@@@@@@))))@@U@@-bounded_splitJ@ @@@@@@@@@@@%#@@@@@@@@@@@@@4**5*+.@@?V@@+split_delimK@-@@@@8@@@B@@@@@@@@@@@@Q++R++@@\W@@3bounded_split_delimL@J@@@@U@@@@@@@ec@@@@@@@@@@@@@t--u--P@@X@@,split_resultM;@@$Text,x@@@@@ ..  ...@@Z@%Delim-@@@@@ ./.1 ./.B@@[@@@A@@@@@..@@@@Y@A@*full_splitN@@@@@@@@:@@@@@@@@@@@ .D.D .D.z@@\@@2bounded_full_splitO@@@@@@@@@W@@@ʠ#@@@@@@@@@@@@@////@@]@@-string_beforeP@@@@@t@@@@@@@@@@@0001 @@^@@,string_afterQ@@@@@@@@@@@@@@@@ #11 #11@@_@@+first_charsR@ @@@@@@@@@@@@@@@#(2v2v$(2v2@@.`@@*last_charsS@"@@@@@@@,@@@@@@@@<,33=,33A@@Ga@@@a7-#Str0IM/Qkv&Stdlib0Lku]8_٠8CamlinternalFormatBasics0%FU(Q/Tu@@@Caml1999T037QvEC#Str*ocaml.text&_none_@@A 6 Regular expressions and high-level string processing 5otherlibs/str/str.mliP77P7r@@@@@@3@@@@@@#intA;@@#intA@@@@@;@A@$charB;@@$charA@@@@@A@A@&stringQ;@@&stringA@@@@@G@@@%bytesC;@@%bytesA@@@@@M@@@%floatD;@@%floatA@@@@@S@@@$boolE;@@%falsec@@]@$trued@@c@@@A@@@@@d@A@$unitF;@@"()e@@n@@@A@@@@@o@A@ #exnG;@@@A@@@@@s@@@#effH;@@O@A@A@@@@@@|@@@,continuationI;@@Q@@P@B,continuationA@nY@@@@@@@@@%arrayJ;@@R@A%arrayA@@@@@@@@@ $listK;@@S@A"[]f@@@"::g@@@T@@@ @@A@Y@@@@@@@@&optionL;@@V@A$Noneh@@@$Somei@@@@@A@Y@@@@@@@@)nativeintM;@@)nativeintA@@@@@@@@%int32N;@@%int32A@@@@@@@@%int64O;@@%int64A@@@@@@@@&lazy_tP;@@X@A&lazy_tA@Y@@@@@@@@ 5extension_constructorR;@@5extension_constructorA@@@@@@@@*floatarrayS;@@*floatarrayA@@@@@@@@&iarrayT;@@Y@A&iarrayA@Y@@@@@@@@ *atomic_locU;@@Z@A*atomic_locA@@@@@@ @@@ .Assert_failure`#@@@@@J@@@@@@@@[@@A!=ocaml.warn_on_literal_pattern%@&@0Division_by_zero]#@@@A+ . .@+End_of_file\#$@@@A366@'FailureY#,@'@@A<??@0Invalid_argumentX#5@0@@AE$H#H@-Match_failureV#>@@=@9@;@@a@@AV5Y4Y@)Not_foundZ#O@@@A^=a<a@-Out_of_memoryW#W@@@AfEiDi@.Stack_overflow^#_@@@AnMqLq@.Sys_blocked_io_#g@@@AvUyTy@)Sys_error[#o@j@@A^]@:Undefined_recursive_modulea#x@@w@s@u@@h@@Aon@:Continuation_already_takenb#@@@Awv@&Stdlib@A9 {1 Regular expressions} SuuSu@@@@@@ The {!Str} library provides regular expressions on sequences of bytes. It is, in general, unsuitable to match Unicode characters. UX!@@@@@@A+®expAZ#(Z#.@@;@@@A@@@@@Z##@)ocaml.docԐ + The type of compiled regular expressions. [//[/_@@@@@@@@@@@@@A@䐠@@@@@@@ܰ"@®exp^bf^bl@б@г&string^bo^bu@@ @@@3@A;@A@@гE®exp^by^b@@ @@@@@@@@@@@ ^bb @K  Compile a regular expression. The following constructs are recognized: - [. ] Matches any character except newline. - [* ] (postfix) Matches the preceding expression zero, one or several times - [+ ] (postfix) Matches the preceding expression one or several times - [? ] (postfix) Matches the preceding expression once or not at all - [[..] ] Character set. Ranges are denoted with [-], as in [[a-z]]. An initial [^], as in [[^0-9]], complements the set. To include a [\]] character in a set, make it the first character of the set. To include a [-] character in a set, make it the first or the last character of the set. - [^ ] Matches at beginning of line: either at the beginning of the matched string, or just after a '\n' character. - [$ ] Matches at end of line: either at the end of the matched string, or just before a '\n' character. - [\| ] (infix) Alternative between two expressions. - [\(..\)] Grouping and naming of the enclosed expression. - [\1 ] The text matched by the first [\(...\)] expression ([\2] for the second expression, and so on up to [\9]). - [\b ] Matches word boundaries. - [\ ] Quotes special characters. The special characters are [$^\.*+?[]]. In regular expressions you will often use backslash characters; it's easier to use a quoted string literal [{|...|}] to avoid having to escape backslashes. For example, the following expression: {[ let r = Str.regexp {|hello \([A-Za-z]+\)|} in Str.replace_first r {|\1|} "hello world" ]} returns the string ["world"]. If you want a regular expression that matches a literal backslash character, you need to double it: [Str.regexp {|\\|}]. You can use regular string literals ["..."] too, however you will have to escape backslashes. The example above can be rewritten with a regular string literal as: {[ let r = Str.regexp "hello \\([A-Za-z]+\\)" in Str.replace_first r "\\1" "hello world" ]} And the regular expression for matching a backslash becomes a quadruple backslash: [Str.regexp "\\\\"]. _L)X@@@@@@@3A@@@[.@@@@@@10regexp_case_fold1NZ^2NZn@б@г&string<NZq=NZw@@ @@@3>==>>>>>@J_8@A@@г®expKNZ{LNZ@@ @@@@@@@@@@@VNZZ @ Same as [regexp], but the compiled expression will match text in a case-insensitive way: uppercase and lowercase letters will be considered equivalent. cOdQ(@@@@@@@|B@@@w@@@@@@1%quotezS*.{S*3@б@гL&stringS*6S*<@@ @@@3@J_8@A@@г[&stringS*@S*F@@ @@@@@@@@@@@S** @ݐ U [Str.quote s] returns a regexp string that matches exactly [s] and nothing else. TGGU@@@@@@@C@@@@@@@@@1-regexp_stringWW@б@г&stringWW@@ @@@3@J_8@A@@г ®expWW@@ @@@@@@@@@@@W @& a [Str.regexp_string s] returns a regular expression that matches exactly [s] and nothing else.XY.@@@@@@@D@@@6 @@@@@@17regexp_string_case_fold [04 [0K@б@гޠ&string[0N[0T@@ @@@3@J_8@A@@гi®exp&[0X'[0^@@ @@@@@@@@@@@1[00 @o x [Str.regexp_string_case_fold] is similar to {!Str.regexp_string}, but the regexp matches in a case-insensitive way. >\__?]@@@@@@@WE@@@R@@@@@@1`_ # {1 String matching and searching} \`]`@@@@@@3[ZZ[[[[[@CX1@A,string_matchhc ic @б@г®expsc tc #@@ @@@@@б@гI&stringc 'c -@@ @@@)@@б@гd#intc 1c 4@@ @@@8@@гS$boolc 8c <@@ @@@E@@@@@H@@@%@@K( @@@7@@N:@@@c  @퐠 [string_match r s start] tests whether a substring of [s] that starts at position [start] matches the regular expression [r]. The first character of a string has position [0], as usual. d==f@@@@@@@F@@!@А@@@@@@m.search_forwardh h@б@г!®exphh @@ @@@3@8@A@@б@г&stringh$h*@@ @@@@@б@гѠ#inth.h1@@ @@@ @@гޠ#int h5 h8@@ @@@-@@@@@0@@@%@@3( @@@9@@6<@@@h@Z 9 [search_forward r s start] searches the string [s] for a substring matching the regular expression [r]. The search starts at position [start] and proceeds towards the end of the string. Return the position of the first character of the matched substring. @raise Not_found if no substring matches. )i99*nHw@@@@@@@BG@@!@j=@@@@@@U/search_backward@py}Apy@б@г®expKpyLpy@@ @@@3MLLMMMMM@n8@A@@б@г#&string\py]py@@ @@@@@б@г>#intkpylpy@@ @@@ @@гK#intxpyypy@@ @@@-@@@@@0@@@%@@3( @@@9@@6<@@@pyy@ǐ T [search_backward r s last] searches the string [s] for a substring matching the regular expression [r]. The search first considers substrings that start at position [last] and proceeds towards the beginning of string. Return the position of the first character of the matched substring. @raise Not_found if no substring matches. qv@@@@@@@H@@!@@@@@@@U4string_partial_matchx  x !@б@г®expx $x *@@ @@@3@n8@A@@б@г&stringx .x 4@@ @@@@@б@г#intx 8x ;@@ @@@ @@г$boolx ?x C@@ @@@-@@@@@0@@@%@@3( @@@9@@6<@@@x  @4 Similar to {!Str.string_match}, but also returns true if the argument string is a prefix of a string that matches. This includes the case of a true complete match. yDD{@@@@@@@I@@!@D@@@@@@U.matched_string}}@б@г점&string%} &}@@ @@@3'&&'''''@n8@A@@г&string4}5}@@ @@@@@@@@@@@?} @}  [matched_string s] returns the substring of [s] that was matched by the last call to one of the following matching or searching functions: - {!Str.string_match} - {!Str.search_forward} - {!Str.search_backward} - {!Str.string_partial_match} - {!Str.global_substitute} - {!Str.substitute_first} provided that none of the following functions was called in between: - {!Str.global_replace} - {!Str.replace_first} - {!Str.split} - {!Str.bounded_split} - {!Str.split_delim} - {!Str.bounded_split_delim} - {!Str.full_split} - {!Str.bounded_full_split} Note: in the case of [global_substitute] and [substitute_first], a call to [matched_string] is only valid within the [subst] argument, not after [global_substitute] or [substitute_first] returns. The user must make sure that the parameter [s] is the same string that was passed to the matching or searching function. L~M@@@@@@@eJ@@@`@@@@@@1/match_beginningcd@б@г$unitno@@ @@@3pooppppp@J_8@A@@гP#int}~@@ @@@@@@@@@@@ @Ɛ [match_beginning()] returns the position of the first character of the substring that was matched by the last call to a matching or searching function (see {!Str.matched_string} for details). q@@@@@@@K@@@@@@@@@1)match_end@б@г[$unit@@ @@@3@J_8@A@@г#int@@ @@@@@@@@@@@ @ [match_end()] returns the position of the character following the last character of the substring that was matched by the last call to a matching or searching function (see {!Str.matched_string} for details). @@@@@@@L@@@򐠠@@@@@@1-matched_group@б@гӠ#int@@ @@@3@J_8@A@@б@гؠ&string@@ @@@@@г堐&string@@ @@@@@@@@!@@@'@@$* @@@,@j  [matched_group n s] returns the substring of [s] that was matched by the [n]th group [\(...\)] of the regular expression that was matched by the last call to a matching or searching function (see {!Str.matched_string} for details). When [n] is [0], it returns the substring matched by the whole regular expression. The user must make sure that the parameter [s] is the same string that was passed to the matching or searching function. @raise Not_found if the [n]th group of the regular expression was not matched. This can happen with groups inside alternatives [\|], options [?] or repetitions [*]. For instance, the empty string will match [\(a\)*], but [matched_group 1 ""] will raise [Not_found] because the first group itself was not matched. 9:@@@@@@@RM@@@zM@@@@@@C/group_beginning PQ@б@г.#int[\@@ @@@3]\\]]]]]@\q8@A@@г=#intjk@@ @@@@@@@@@@@u @  [group_beginning n] returns the position of the first character of the substring that was matched by the [n]th group of the regular expression that was matched by the last call to a matching or searching function (see {!Str.matched_string} for details). @raise Not_found if the [n]th group of the regular expression was not matched. @raise Invalid_argument if there are fewer than [n] groups in the regular expression.   @@@@@@@N@@@@@@@@@1)group_end!    @б@гw#int    @@ @@@3@J_8@A@@г#int    @@ @@@@@@@@@@@   @  [group_end n] returns the position of the character following the last character of substring that was matched by the [n]th group of the regular expression that was matched by the last call to a matching or searching function (see {!Str.matched_string} for details). @raise Not_found if the [n]th group of the regular expression was not matched. @raise Invalid_argument if there are fewer than [n] groups in the regular expression.   ""@@@@@@@O@@@ ߐ@@@@@@1쐠1 {1 Replacement} """"@@@@@@3@CX1@A.global_replace"""""@б@гC®exp""""@@ @@@@@б@г֠&string"#"#@@ @@@)@@б@г堐&string"# "#@@ @@@8@@г&string+"#,"#@@ @@@E@@@@@H@@@%@@K( @@@7@@N:@@@<""@z  [global_replace regexp templ s] returns a string identical to [s], except that all substrings of [s] that match [regexp] have been replaced by [templ]. The replacement template [templ] can contain [\1], [\2], etc; these sequences will be replaced by the text matched by the corresponding group in the regular expression. [\0] stands for the text matched by the whole regular expression. I##J$m$@@@@@@@bP@@!@]@@@@@@m-replace_first#`$$a$$@б@г®expk$$l$$@@ @@@3mllmmmmm@8@A@@б@гC&string|$$}$$@@ @@@@@б@гR&string$$$$@@ @@@ @@г_&string$$$$@@ @@@-@@@@@0@@@%@@3( @@@9@@6<@@@$$@琠 u Same as {!Str.global_replace}, except that only the first substring matching the regular expression is replaced. $$%7%i@@@@@@@Q@@!@ʐ@@@@@@U1global_substitute$%k%o%k%@б@г®exp%k%%k%@@ @@@3@n8@A@@б@б@г&string%k%%k%@@ @@@@@г&string%k%%k%@@ @@@ @@@@@#@@б@гѠ&string %k% %k%@@ @@@2@@гޠ&string%k%%k%@@ @@@?@@@@@B@@@$@@E#%k% @@@L@@IO@@@)%k%k@g / [global_substitute regexp subst s] returns a string identical to [s], except that all substrings of [s] that match [regexp] have been replaced by the result of function [subst]. The function [subst] is called once for each matching substring, and receives [s] (the whole text) as argument. 6%%7&&@@@@@@@OR@@"@wJ@@@@@@h0substitute_first%M&&N&&@б@г®expX&'Y&'@@ @@@3ZYYZZZZZ@8@A@@б@б@г2&stringk&' l&'@@ @@@@@г?&stringx&'y&'@@ @@@ @@@@@#@@б@гQ&string&'!&''@@ @@@2@@г^&string&'+&'1@@ @@@?@@@@@B@@@$@@E&'  @@@L@@IO@@@&&@琠 x Same as {!Str.global_substitute}, except that only the first substring matching the regular expression is replaced. '2'2'}'@@@@@@@S@@"@ʐ@@@@@@h/replace_matched&''''@б@г&string''''@@ @@@3@8@A@@б@г&string''''@@ @@@@@г&string''''@@ @@@@@@@@!@@@'@@$* @@@ ''@B  [replace_matched repl s] returns the replacement text [repl] in which [\1], [\2], etc. have been replaced by the text matched by the corresponding groups in the regular expression that was matched by the last call to a matching or searching function (see {!Str.matched_string} for details). [s] must be the same string that was passed to the matching or searching function.  '' )W)p@@@@@@@ *T@@@R %@@@@@@C 3 2/ {1 Splitting}  /)s)s 0)s)@@@@@@3 . - - . . . . .@Uj1@A%split' ;)) <))@б@г®exp F)) G))@@ @@@@@б@г &string U)) V))@@ @@@)@@гӠ$list b)) c))@г 3&string l)) m))@@ @@@@@@@@@@E @@@"@@H%@@@4@@ K7@@@ ))@ 7 [split r s] splits [s] into substrings, taking as delimiters the substrings that match [r], and returns the list of substrings. For instance, [split (regexp "[ \t]+") s] splits [s] into blank-separated words. An occurrence of the delimiter at the beginning or at the end of the string is ignored.  )) **@@@@@@@ U@@-@ @@@@@@j-bounded_split( ** *+@б@г®exp *+ *+@@ @@@ 3        @~8@A@@б@г &string *+ *+@@ @@@ @@б@г #int *+ *+@@ @@@  @@г L$list *+* *+.@г &string *+# *+)@@ @@@ 7@@@@@@< @@@"@@?%@@@4@@B7@@@H@@EK@@@ ** @9 l Same as {!Str.split}, but splits into at most [n] substrings, where [n] is the extra integer parameter.  +/+/ +q+@@@@@@@ !V@@0@I @@@@@@d+split_delim) ++ ++@б@гm®exp *++ +++@@ @@@3 , + + , , , , ,@}8@A@@б@г &string ;++ <++@@ @@@@@г $list H++ I++@г &string R++ S++@@ @@@(@@@@@@- @@@"@@0%@@@6@@39@@@ e++@ 5 Same as {!Str.split} but occurrences of the delimiter at the beginning and at the end of the string are recognized and returned as empty strings in the result. For instance, [split_delim (regexp " ") " abc "] returns [[""; "abc"; ""]], while [split] with the same arguments returns [["abc"]].  r++ s,-@@@@@@@ W@@-@ @@@@@@R3bounded_split_delim* -- --'@б@гנ®exp --* --0@@ @@@3        @k8@A@@б@г l&string --4 --:@@ @@@@@б@г #int --> --A@@ @@@ @@г 2$list --L --P@г &string --E --K@@ @@@7@@@@@@< @@@"@@ ?%@@@4@@!B7@@@H@@"EK@@@ -- @  Same as {!Str.bounded_split}, but occurrences of the delimiter at the beginning and at the end of the string are recognized and returned as empty strings in the result.  -Q-Q -.@@@@@@@ X@@0@ / @@@@@@dA+,split_result+B ..  ..@@;@@$Text, @@@#@@  ..   ...@@ .Z@%Delim- @@@$@@ # ./.1 $ ./.B@@ <[@@@A@@@@@ '..@@@@ ?Y@@#   . ..$@@г!&string 7 ..("@@(3 5 4 4 5 5 5 5 5@\9;@@@A@@@@@@@@@A(@@@@*@#&& B ./.3 C ./.8@@г(&string L ./.<)@@/*@@@@,@@A@(@@3 K J J K K K K K@@A),@*full_split. X .D.H Y .D.R@б@г ®exp c .D.U d .D.[@@ @@@.3 e d d e e e e e@0hb@A@@б@г ;&string t .D._ u .D.e@@ @@@/@@г $list  .D.v  .D.z@г,split_result  .D.i  .D.u@@ @@@0(@@@@@@2- @@@"@@30%@@@6@@439@@@  .D.D@ ܐ 0 Same as {!Str.split_delim}, but returns the delimiters as well as the substrings contained between delimiters. The former are tagged [Delim] in the result list; the latter are tagged [Text]. For instance, [full_split (regexp "[{}]") "{ab}"] returns [[Delim "{"; Text "ab"; Delim "}"]].   .{.{ //@@@@@@@ \@@-@  @@@@@@R2bounded_full_split/ // //@б@г ®exp // //@@ @@@53        @k8@A@@б@г &string // //@@ @@@6@@б@г #int // //@@ @@@7 @@г k$list // //@г,split_result // //@@ @@@87@@@@@@:< @@@"@@;?%@@@4@@<B7@@@H@@=EK@@@ // @ X Same as {!Str.bounded_split_delim}, but returns the delimiters as well as the substrings contained between delimiters. The former are tagged [Delim] in the result list; the latter are tagged [Text].  '// (00@@@@@@@ @]@@0@ h ;@@@@@@d I H; {1 Extracting substrings}  E00 F00@@@@@@3 D C C D D D D D@v1@A-string_before0 Q00 R01@б@г #&string \01  ]01@@ @@@>@@б@г >#int k01 l01@@ @@@?)@@г ?&string x01 y01 @@ @@@@6@@@@@A9@@@%@@B<( @@@ 00@ Đ [string_before s n] returns the substring of all characters of [s] that precede position [n] (excluding the character at position [n]).  1!1! !11@@@@@@@ ^@@@  @@@@@@[,string_after1 #11 #11@б@г |&string #11 #11@@ @@@C3        @to8@A@@б@г #int #11 #11@@ @@@D@@г &string #11 #11@@ @@@E@@@@@F!@@@'@@G$* @@@ #11@  [string_after s n] returns the substring of all characters of [s] that follow position [n] (including the character at position [n]).  $11 &2`2t@@@@@@@ _@@@ / @@@@@@C+first_chars2 (2v2z (2v2@б@г נ&string (2v2 (2v2@@ @@@H3        @\q8@A@@б@г #int !(2v2 "(2v2@@ @@@I@@г &string .(2v2 /(2v2@@ @@@J@@@@@K!@@@'@@L$* @@@ <(2v2v@ z r [first_chars s n] returns the first [n] characters of [s]. This is the same function as {!Str.string_before}.  I)22 J*23@@@@@@@ b`@@@  ]@@@@@@C*last_chars3 `,33 a,33'@б@г 2&string k,33* l,330@@ @@@M3 m l l m m m m m@\q8@A@@б@г O#int |,334 },337@@ @@@N@@г P&string ,33; ,33A@@ @@@O@@@@@P!@@@'@@Q$* @@@ ,33@ Ր : [last_chars s n] returns the last [n] characters of [s].  -3B3B -3B3@@@@@@@ a@@@  @@@@@@C@  A@  @  e@ E @  @  @ ] @  @  >@ @@lE@%@@^@>@@{0@@4@@b@B@@`@A@M@-@i@I@@^@@3        @`@A@ H************************************************************************ A@@ A@L@ H  BMMBM@ H OCaml CC@ H  D D3@ H Xavier Leroy, projet Cristal, INRIA Rocquencourt E44E4@ H FF@ H Copyright 1996 Institut National de Recherche en Informatique et GG@ H en Automatique. #H$Hg@ H )Ihh*Ih@ H All rights reserved. This file is distributed under the terms of /J0J@ H the GNU Lesser General Public License version 2.1, with the 5K6KN@ H special exception on linking described in the file LICENSE. ;LOO