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@@@Caml1999T037^pQ@EC#Str*ocaml.text&_none_@@A 6 Regular expressions and high-level string processing 5otherlibs/str/str.mliP77P7r@@@@@@3@@@@#intA;@@A@@@@@9@A@$charB;@@A@@@@@>@A@&stringQ;@@A@@@@@C@@@%bytesC;@@A@@@@@H@@@%floatD;@@A@@@@@M@@@$boolE;@@%falsec@@W@$trued@@]@@@A@@@@@^@A@$unitF;@@"()e@@h@@@A@@@@@i@A@ #exnG;@@@A@@@@@m@@@#effH;@@O@A@A@@@@@@v@@@,continuationI;@@Q@@P@B A@nY@@@@@@@@@%arrayJ;@@R@AA@@@@@@@@@ $listK;@@S@A"[]f@@@"::g@@@T@@@ @@A@Y@@@@@@@@&optionL;@@V@A$Noneh@@@$Somei@@@@@A@Y@@@@@@@@)nativeintM;@@A@@@@@@@@%int32N;@@A@@@@@@@@%int64O;@@A@@@@@@@@&lazy_tP;@@X@AA@Y@@@@@@@@ 5extension_constructorR;@@A@@@@@@@@*floatarrayS;@@A@@@@@@@@&iarrayT;@@Y@AA@Y@@@@@@@@ *atomic_locU;@@Z@AA@@@@@@@@@ .Assert_failure`#@@@@@J@@@@@@@@[@@A=ocaml.warn_on_literal_pattern@@0Division_by_zero]#@@@A  @+End_of_file\#$@@@A#&&@'FailureY#,@'@@A,//@0Invalid_argumentX#5@0@@A5$8#8@-Match_failureV#>@@=@9@;@@a@@AF5I4I@)Not_foundZ#O@@@AN=Q<Q@-Out_of_memoryW#W@@@AVEYDY@.Stack_overflow^#_@@@A^MaLa@.Sys_blocked_io_#g@@@AfUiTi@)Sys_error[#o@j@@Ao^r]r@: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@@@@@@@#A@@@[@@@@@@10regexp_case_fold!NZ^"NZn@б@г&string,NZq-NZw@@ @@@3........@J_8@A@@г®exp;NZ{<NZ@@ @@@@@@@@@@@FNZZ @ Same as [regexp], but the compiled expression will match text in a case-insensitive way: uppercase and lowercase letters will be considered equivalent. SOTQ(@@@@@@@lB@@@g@@@@@@1%quotejS*.kS*3@б@г?&stringuS*6vS*<@@ @@@3wwwwwwww@J_8@A@@гN&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^@@ @@@@@@@@@@@![00 @o x [Str.regexp_string_case_fold] is similar to {!Str.regexp_string}, but the regexp matches in a case-insensitive way. .\__/]@@@@@@@GE@@@B@@@@@@1PO # {1 String matching and searching} L`M`@@@@@@3KKKKKKKK@CX1@A,string_matchXc Yc @б@г®expcc dc #@@ @@@@@б@г<&stringrc 'sc -@@ @@@)@@б@гU#intc 1c 4@@ @@@8@@гI$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@@ @@@ @@гϠ#inth5h8@@ @@@-@@@@@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. i99nHw@@@@@@@2G@@!@j-@@@@@@U/search_backward0py}1py@б@г®exp;py<py@@ @@@3========@n8@A@@б@г&stringLpyMpy@@ @@@@@б@г/#int[py\py@@ @@@ @@г<#inthpyipy@@ @@@-@@@@@0@@@%@@3( @@@9@@6<@@@ypyy@ǐ 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@@г&string$}%}@@ @@@@@@@@@@@/} @}  [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. <~=@@@@@@@UJ@@@P@@@@@@1/match_beginningST@б@г$unit^_@@ @@@3````````@J_8@A@@гA#intmn@@ @@@@@@@@@@@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). q@@@@@@@K@@@@@@@@@1)match_end@б@гQ$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. )*@@@@@@@BM@@@z=@@@@@@C/group_beginning @A@б@г#intKL@@ @@@3MMMMMMMM@\q8@A@@г.#intZ[@@ @@@@@@@@@@@e @  [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. rs  @@@@@@@N@@@@@@@@@1)group_end!    @б@гh#int    @@ @@@3@J_8@A@@гw#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. 9##:$m$@@@@@@@RP@@!@M@@@@@@m-replace_first#P$$Q$$@б@г®exp[$$\$$@@ @@@3]]]]]]]]@8@A@@б@г6&stringl$$m$$@@ @@@@@б@гE&string{$$|$$@@ @@@ @@гR&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. &%%'&&@@@@@@@?R@@"@w:@@@@@@h0substitute_first%=&&>&&@б@г®expH&'I&'@@ @@@3JJJJJJJJ@8@A@@б@б@г%&string[&' \&'@@ @@@@@г2&stringh&'i&'@@ @@@ @@@@@#@@б@гD&stringz&'!{&''@@ @@@2@@гQ&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 # "/ {1 Splitting}  )s)s )s)@@@@@@3        @Uj1@A%split' +)) ,))@б@г®exp 6)) 7))@@ @@@@@б@г &string E)) F))@@ @@@)@@гˠ$list R)) S))@г &&string \)) ]))@@ @@@@@@@@@@E @@@"@@H%@@@4@@ K7@@@ o))@ 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@@б@г y&string *+ *+@@ @@@ @@б@г #int *+ *+@@ @@@  @@г D$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 8++ 9++@г &string B++ C++@@ @@@(@@@@@@- @@@"@@0%@@@6@@39@@@ U++@ 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"]].  b++ c,-@@@@@@@ {W@@-@ v@@@@@@R3bounded_split_delim* y-- z--'@б@гנ®exp --* --0@@ @@@3        @k8@A@@б@г _&string --4 --:@@ @@@@@б@г x#int --> --A@@ @@@ @@г *$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 ' ..("@@(3 % % % % % % % %@\9;@@@A@@@@@@@@@A(@@@@*@#&& 2 ./.3 3 ./.8@@г(&string < ./.<)@@/*@@@@,@@A@(@@3 ; ; ; ; ; ; ; ;@@A),@*full_split. H .D.H I .D.R@б@г ®exp S .D.U T .D.[@@ @@@.3 U U U U U U U U@0hb@A@@б@г .&string d .D._ e .D.e@@ @@@/@@г ꠐ$list q .D.v r .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 @@г c$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]@@0@ h +@@@@@@d 9 8; {1 Extracting substrings}  500 600@@@@@@3 4 4 4 4 4 4 4 4@v1@A-string_before0 A00 B01@б@г &string L01  M01@@ @@@>@@б@г /#int [01 \01@@ @@@?)@@г 2&string h01 i01 @@ @@@@6@@@@@A9@@@%@@B<( @@@ v00@ Đ [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@б@г o&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}.  9)22 :*23@@@@@@@ R`@@@  M@@@@@@C*last_chars3 P,33 Q,33'@б@г %&string [,33* \,330@@ @@@M3 ] ] ] ] ] ] ] ]@\q8@A@@б@г @#int l,334 m,337@@ @@@N@@г C&string y,33; z,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  BMM BM@ H OCaml  C C@ 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. HHg@ H IhhIh@ H All rights reserved. This file is distributed under the terms of J J@ H the GNU Lesser General Public License version 2.1, with the %K&KN@ H special exception on linking described in the file LICENSE. +LOO,LO@ H 1M2M@ H************************************************************************7N8N5@ 7* Regular expressions and high-level string processing =:* {1 Regular expressions}  * The {!Str} library provides regular expressions on sequences of bytes. It is, in general, unsuitable to match Unicode characters.  ,* The type of compiled regular expressions.  * 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 "\\\\"].  ? * Same as [regexp], but the compiled expression will match text in a case-insensitive way: uppercase and lowercase letters will be considered equivalent.  V* [Str.quote s] returns a regexp string that matches exactly [s] and nothing else.  b* [Str.regexp_string s] returns a regular expression that matches exactly [s] and nothing else. m y* [Str.regexp_string_case_fold] is similar to {!Str.regexp_string}, but the regexp matches in a case-insensitive way.  ' $* {1 String matching and searching}  * [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.  :* [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.  E U* [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.  ۠ * 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.  q * [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.  + * [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). 堠 * [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).  * [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. G * [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.  * [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. 2* {1 Replacement}  * [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. C v* Same as {!Str.global_replace}, except that only the first substring matching the regular expression is replaced. ٠ 0* [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. \ y* Same as {!Str.global_substitute}, except that only the first substring matching the regular expression is replaced. ߠ * [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. 0* {1 Splitting} l 8* [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.  m* Same as {!Str.split}, but splits into at most [n] substrings, where [n] is the extra integer parameter.  6* 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"]]. 2 * 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.  1* 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 "}"]].  * 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]. <* {1 Extracting substrings} k * [string_before s n] returns the substring of all characters of [s] that precede position [n] (excluding the character at position [n]).  * [string_after s n] returns the substring of all characters of [s] that follow position [n] (including the character at position [n]). Ƞ s* [first_chars s n] returns the first [n] characters of [s]. This is the same function as {!Str.string_before}. p ;* [last_chars s n] returns the last [n] characters of [s]. @,./ocamlc.opt)-nostdlib"-I(./stdlib"-g0-strict-sequence*-principal(-absname"-w8+a-4-9-40-41-42-44-45-48+-warn-error"+a*-bin-annot/-strict-formats"-I-otherlibs/str"-I%utils"-I'parsing"-I&typing"-I(bytecomp"-I,file_formats"-I&lambda"-I*middle_end"-I2middle_end/closure"-I2middle_end/flambda"-I=middle_end/flambda/base_types"-I'asmcomp"-I&driver"-I(toplevel"-I%tools"-I'runtime"-I1otherlibs/dynlink"-I-otherlibs/str"-I4otherlibs/systhreads"-I.otherlibs/unix"-I8otherlibs/runtime_events"-c S/home/teraram/ci/builds/workspace/parallel-build/flambda/true/label/ocaml-manycores <10/.-,+*)('&%$#"! @@0=N4F-; 3@@@8CamlinternalFormatBasics0%FU(Q/Tu&Stdlib0Lku]8_٠%0IM/Qkv@0IM/QkvAb@ 7  "@r@e@԰x@@(  R@ x @@9@@ 7   q@@R@@  @  2  @@  @ { @'@bϰƐ g@@C0I@6^@@G@@@@=$   ϐ @ q @@P@@