Caml1999I031G #Str®exp,8@@@A@@@@@'str.mliVV@@@@ @A@®exp-@&stringO@@@[@@@\@@]@ZZ@@ A@0regexp_case_fold.@@@@^@@@_@@`@(J  )J  @@2B@%quote/@'@@@a+@@@b@@c@;O<O@@EC@-regexp_string0@:@@@d8@@@e@@f@MSNS:@@WD@7regexp_string_case_fold1@L@@@gJ@@@h@@i@_W`W@@iE@,string_match2@X@@@j@c@@@k@#intA@@@l$boolE@@@m@@n@@o@@p@_}}_}@@F@.search_forward3@z@@@q@@@@r@"@@@s&@@@t@@u@@v@@w@dxxdx@@G@/search_backward4@@@@x@@@@y@@@@@zD@@@{@@|@@}@@~@ll @@H@4string_partial_match5@@@@@@@@@^@@@\@@@@@@@@@@t||t|@@I@.matched_string6@@@@@@@@@@yiiyi@@J@/match_beginning7@$unitF@@@@@@@@@:::[@@ K@)match_end8@@@@@@@@@@***E@@ L@-matched_group9@@@@@@@@@@@@@@@@/((0(S@@9M@/group_beginning:@@@@@@@@@@BooCo@@LN@)group_end;@@@@@@@@@@U P PV P j@@_O@.global_replace<@N@@@@Y@@@@_@@@c@@@@@@@@@@s"U"Ut"U"@@}P@-replace_first=@l@@@@w@@@@}@@@@@@@@@@@@@$)$)$)$a@@Q@1global_substitute>@@@@@@@@@@@@@@@@@@@@@@@@@@@@$$$%&@@R@0substitute_first?@@@@@@@@@@@@@@@@@@@@@@@@@@@@&]&]&]&@@S@/replace_matched@@@@@@@@@@@@@@@@@'$'$'$'T@@T@%splitA@@@@@@@@$listI@@@@@@@@@@@((()(@@U@-bounded_splitB@ @@@@@@@@@@@%#@@@@@@@@@@@@@4*g*g5*g*@@>V@+split_delimC@-@@@@8@@@B@@@@@@@@@@@@Q++R++F@@[W@3bounded_split_delimD@J@@@@U@@@@@@@ec@@@@@@@@@@@@@t,,u,,@@~X@,split_resultE8@@$Text$x@@@@@----@@Z%Delim%@@@@@----@@[@@A@@@@@-{-{@@@@YA@*full_splitF@@@@@@@@:@@@@@@@@@@@----@@\@2bounded_full_splitG@@@@@@@@@W@@@ʠ#@@@@@@@@@@@@@/%/%/%/j@@]@-string_beforeH@@@@@t@@@@@@@@@@@0h0h0h0@@^@,string_afterI@@@@@@@@@@@@@@@@ 1*1* 1*1T@@_@+first_charsJ@ @@@@@@@@@@@@@@@#$11$$12@@-`@*last_charsK@"@@@@@@@,@@@@@@@@<(22=(22@@Fa@@a7-#Str0 鑁?Fzp 3&Stdlib0>,W:(8CamlinternalFormatBasics0cEXy<#Str*ocaml.text&_none_@@A 6 Regular expressions and high-level string processing 'str.mliP77P7r@@@@@@0@@@@@@%arrayH8@@M@A@A@@@@@@8@@@$boolE8@@%false^@@B@$true_@@H@@@A@@@@@I@A@$charB8@@@A@@@@@M@A@#exnG8@@AA@@@@@Q@@@5extension_constructorP8@@@A@@@@@U@@@%floatD8@@@A@@@@@Y@@@*floatarrayQ8@@@A@@@@@]@@@#intA8@@@A@@@@@a@A@%int32L8@@@A@@@@@e@@@%int64M8@@@A@@@@@i@@@&lazy_tN8@@O@A@A@Y@@@@@r@@@$listI8@@P@A"[]a@@@"::b@@@Q@@@ @@A@Y@@@@@@@@)nativeintK8@@@A@@@@@@@@&optionJ8@@S@A$Nonec@@@$Somed@@@@@A@Y@@@@@@@@&stringO8@@@A@@@@@@@@$unitF8@@"()`@@@@@A@@@@@@A@ .Assert_failure\ p@@@@Jm@@@@@@V@@A͠=ocaml.warn_on_literal_patternѐ@@0Division_by_zeroY @@@Aנ  @+End_of_fileX !@@@Aߠ@'FailureU )@%@@A蠰@0Invalid_argumentT 2@.@@A񠰠$#@-Match_failureR ;@:67@@\@@A21@ )Not_foundV I@@@A: 9 @-Out_of_memoryS Q@@@ABA@.Stack_overflowZ Y@@@AJI@.Sys_blocked_io[ a@@@AR"Q"@)Sys_errorW i@e@@A([+Z+@:Undefined_recursive_module] r@qmn@@c@@A6i9h9@ %bytesC8@@@A@@@@@=@@@&Stdlib@A6G9 {1 Regular expressions} BSuuCSu@@@@@@AA(®exp AMVNV@@8@@@A@@@@@QV@)ocaml.docb + The type of compiled regular expressions. _W`W@@@@@@@@@w@@@A@@_@®exp kZlZ@б@гӠ&stringvZwZ@@ @@@0xwwxxxxx@w4.@A@@г8®expZZ@@ @@@@@@@@@@@Z @?  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 "\\\\"]. [H  @@@@@@@A@@%0regexp_case_fold J  J  @б@г&stringJ  J  @@ @@@0@>S,@A@@гu®expJ  J  @@ @@@@@@@@@@@J   @| Same as [regexp], but the compiled expression will match text in a case-insensitive way: uppercase and lowercase letters will be considered equivalent. K  M{@@@@@@@B@@%%quote OO@б@гM&stringOO@@ @@@0@>S,@A@@г\&stringOO@@ @@@@@@@@@@@ O @ U [Str.quote s] returns a regexp string that matches exactly [s] and nothing else. PQ@@@@@@@.C@@%-regexp_string"S#S'@б@г&string-S*.S0@@ @@@0/../////@>S,@A@@г®exp<S4=S:@@ @@@@@@@@@@@GS @ a [Str.regexp_string s] returns a regular expression that matches exactly [s] and nothing else.ST;;TUr@@@@@@@kD@@%7regexp_string_case_fold_W`W@б@гǠ&stringjWkW@@ @@@0lkklllll@>S,@A@@г,®expyWzW@@ @@@@@@@@@@@W @3 x [Str.regexp_string_case_fold] is similar to {!Str.regexp_string}, but the regexp matches in a case-insensitive way. XYO@@@@@@@E@@% # {1 String matching and searching} \RR\Rz@@@@@@0@5J#@A,string_match_}_}@б@гk®exp_}_}@@ @@@@@б@г$&string_}_}@@ @@@)@@б@г#int_}_}@@ @@@8@@г$bool_}_}@@ @@@E@@@@@H@@@%@@K( @@@7@@N:@@@_}}@ [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. `b5v@@@@@@@F@ @a.search_forward dx| dx@б@гʠ®expdxdx@@ @@@0@zu,@A@@б@г&string(dx)dx@@ @@@@@б@г᠐#int7dx8dx@@ @@@ @@г#intDdxEdx@@ @@@-@@@@@0@@@%@@3( @@@9@@6<@@@Udxx@ 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. aebj@@@@@@@yG@ @I/search_backwardmlnl@б@г+®expxlyl@@ @@@0zyyzzzzz@bw,@A@@б@г栐&stringl l@@ @@@@@б@гB#intll@@ @@@ @@гO#intll @@ @@@-@@@@@0@@@%@@3( @@@9@@6<@@@l@e 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. m!!rLz@@@@@@@H@ @I4string_partial_matcht|t|@б@г®expt|t|@@ @@@0@bw,@A@@б@гG&stringt|t|@@ @@@@@б@г#intt|t|@@ @@@ @@гՠ$boolt|t|@@ @@@-@@@@@0@@@%@@3( @@@9@@6<@@@t||@Ɛ 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. #u$w1g@@@@@@@;I@ @I.matched_string/yim0yi{@б@г&string:yi~;yi@@ @@@0<;;<<<<<@bw,@A@@г&stringIyiJyi@@ @@@@@@@@@@@Tyii @  [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. `za8@@@@@@@xJ@@%/match_beginningl:>m:M@б@гР$unitw:Px:T@@ @@@0yxxyyyyy@>S,@A@@г0#int:X:[@@ @@@@@@@@@@@:: @@ [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). \\(@@@@@@@K@@%)match_end*.*7@б@г $unit*:*>@@ @@@0@>S,@A@@гm#int*B*E@@ @@@@@@@@@@@** @} [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). FF&@@@@@@@L@@%-matched_group(,(9@б@г#int(<(?@@ @@@0@>S,@A@@б@г_&string(C(I@@ @@@@@гl&string(M(S@@ @@@@@@@@!@@@'@@$* @@@((@̐  [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. )TT*8m@@@@@@@AM@@7/group_beginning5os6o@б@гꠐ#int@oAo@@ @@@0BAABBBBB@Pe,@A@@г#intOoPo@@ @@@@@@@@@@@Zoo @  [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. fg 1 N@@@@@@@~N@@%)group_endr P Ts P ]@б@г'#int} P `~ P c@@ @@@0~~@>S,@A@@г6#int P g P j@@ @@@@@@@@@@@ P P @F  [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.  k k""9@@@@@@@O@@%1 {1 Replacement} "<"<"<"R@@@@@@0@5J#@A.global_replace"U"Y"U"g@б@г~®exp"U"j"U"p@@ @@@@@б@г7&string"U"t"U"z@@ @@@)@@б@гF&string"U"~"U"@@ @@@8@@гS&string"U""U"@@ @@@E@@@@@H@@@%@@K( @@@7@@N:@@@"U"U@  [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. ""#$'@@@@@@@+P@ @a-replace_first$)$- $)$:@б@гݠ®exp*$)$=+$)$C@@ @@@0,++,,,,,@zu,@A@@б@г&string;$)$G<$)$M@@ @@@@@б@г&stringJ$)$QK$)$W@@ @@@ @@г&stringW$)$[X$)$a@@ @@@-@@@@@0@@@%@@3( @@@9@@6<@@@h$)$)@ u Same as {!Str.global_replace}, except that only the first substring matching the regular expression is replaced. t$b$bu$$@@@@@@@Q@ @I1global_substitute$$$$@б@г>®exp$$$$@@ @@@0@bw,@A@@б@б@г&string$%$%@@ @@@@@г&string$% $%@@ @@@ @@@@@#@@б@г&string$%$%@@ @@@2@@г'&string$% $%&@@ @@@?@@@@@B@@@$@@E$% @@@L@@IO@@@$$@ / [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. %'%'&'&[@@@@@@@R@!@\0substitute_first&]&a&]&q@б@г®exp&]&t&]&z@@ @@@0@u,@A@@б@б@гo&string&]&&]&@@ @@@@@г|&string&]& &]&@@ @@@ @@@@@#@@б@г&string1&]&2&]&@@ @@@2@@г&string>&]&?&]&@@ @@@?@@@@@B@@@$@@EJ&]&~ @@@L@@IO@@@P&]&]@ x Same as {!Str.global_substitute}, except that only the first substring matching the regular expression is replaced. \&&]&'"@@@@@@@tS@!@\/replace_matchedh'$'(i'$'7@б@гР&strings'$':t'$'@@@ @@@0uttuuuuu@u,@A@@б@г᠐&string'$'D'$'J@@ @@@@@г&string'$'N'$'T@@ @@@@@@@@!@@@'@@$* @@@'$'$@N  [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. 'U'U((@@@@@@@T@@7/ {1 Splitting} ((((@@@@@@0@G\#@A%split()()@б@г®exp() ()@@ @@@@@б@г?&string()()@@ @@@)@@г$list()$()(@гV&string()()#@@ @@@@@@@@@@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. ))))*.*e@@@@@@@0U@,@^-bounded_split $*g*k%*g*x@б@г⠐®exp/*g*{0*g*@@ @@@ 010011111@wr,@A@@б@г&string@*g*A*g*@@ @@@ @@б@г#intO*g*P*g*@@ @@@  @@г$list\*g*]*g*@гà&stringf*g*g*g*@@ @@@ 7@@@@@@< @@@"@@?%@@@4@@B7@@@H@@EK@@@|*g*g @+ l Same as {!Str.split}, but splits into at most [n] substrings, where [n] is the extra integer parameter. ***+@@@@@@@V@/@X+split_delim!++++$@б@гR®exp++'++-@@ @@@0@q,@A@@б@г &string++1++7@@ @@@@@гR$list++B++F@г$&string++;++A@@ @@@(@@@@@@- @@@"@@0%@@@6@@39@@@++@ 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"]]. +G+G,_,@@@@@@@W@,@F3bounded_split_delim",,,,@б@г®exp,,,,@@ @@@0@_t,@A@@б@гk&string ,, ,,@@ @@@@@б@гǠ#int ,, ,,@@ @@@ @@г$list *,, +,,@г&string 4,, 5,,@@ @@@7@@@@@@< @@@"@@ ?%@@@4@@!B7@@@H@@"EK@@@ J,, @ 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.  V,, W-<-y@@@@@@@ nX@/@XA(,split_result#B c-{- d-{-@@8@@$Text$@@@#@@ r-- s--@@ Z%Delim%@@@$@@ -- --@@ [@@A@@@@@ -{-{@@@@ Y@   --@@г!&string --"@@(0        @P98@@@A@@@@@@@@@A'@@@@)@%% -- --@@г'&string --(@@.)@@@@+@@A@'@@0        @@A(+@*full_split& -- --@б@гr®exp -- --@@ @@@/0        @/ga@A@@б@г -&string -- --@@ @@@0@@г r$list -- --@г,split_result -- --@@ @@@1(@@@@@@3- @@@"@@40%@@@6@@539@@@ --@ 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 "}"]].   -- ./#@@@@@@@ \@,@F2bounded_full_split' /%/) /%/;@б@гР®exp /%/> /%/D@@ @@@60        @_t,@A@@б@г &string ./%/H //%/N@@ @@@7@@б@г 砐#int =/%/R >/%/U@@ @@@8 @@г ߠ$list J/%/f K/%/j@г,split_result T/%/Y U/%/e@@ @@@97@@@@@@;< @@@"@@<?%@@@4@@=B7@@@H@@>EK@@@ j/%/% @  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].  v/k/k w00B@@@@@@@ ]@/@X ; {1 Extracting substrings}  0E0E 0E0e@@@@@@0        @h}#@A-string_before( 0h0l 0h0y@б@г &string 0h0| 0h0@@ @@@?@@б@г W#int 0h0 0h0@@ @@@@)@@г &string 0h0 0h0@@ @@@A6@@@@@B9@@@%@@C<( @@@ 0h0h@ w [string_before s n] returns the substring of all characters of [s] that precede position [n] (excluding the character at position [n]).  00 11(@@@@@@@ ^@@O,string_after) 1*1. 1*1:@б@г H&string 1*1= 1*1C@@ @@@D0        @hc,@A@@б@г #int 1*1G 1*1J@@ @@@E@@г f&string 1*1N 1*1T@@ @@@F@@@@@G!@@@'@@H$* @@@ 1*1*@ Ɛ [string_after s n] returns the substring of all characters of [s] that follow position [n] (including the character at position [n]).  # 1U1U $"11@@@@@@@ ;_@@7+first_chars* /$11 0$11@б@г &string :$11 ;$12@@ @@@I0 < ; ; < < < < <@Pe,@A@@б@г #int K$12 L$12@@ @@@J@@г &string X$12  Y$12@@ @@@K@@@@@L!@@@'@@M$* @@@ f$11@  r [first_chars s n] returns the first [n] characters of [s]. This is the same function as {!Str.string_before}.  r%22 s&2R2@@@@@@@ `@@7*last_chars+ ~(22 (22@б@г 栐&string (22 (22@@ @@@N0        @Pe,@A@@б@г D#int (22 (22@@ @@@O@@г &string (22 (22@@ @@@P@@@@@Q!@@@'@@R$* @@@ (22@ d : [last_chars s n] returns the last [n] characters of [s].  )22 )22@@@@@@@ a@@7@ ~ xA@ b ;@ ' @  @  @ v O@ *@@n#@@@uN@:@@@wP@+@@o@@R@-@y@e@ @A@K@@p9@%@@R@@0        @xT@A@ H************************************************************************ A@@ A@L@ H  BMM BM@ H OCaml  C C@ H  D D3@ H Xavier Leroy, projet Cristal, INRIA Rocquencourt  #E44 $E4@ H  )F *F@ H Copyright 1996 Institut National de Recherche en Informatique et  /G 0G@ H en Automatique.  5H 6Hg@ H  ;Ihh ,W:( 0 鑁?Fzp 3@0 鑁?Fzp 3A`@pr@~}  @nm  @@\[@  @! @ : 9 a `  @\[@?>@ް s r@ܰ@"!^]@87 5 4@('  @@@P@