D=Q      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ K L M N O P None &)-3457NQRQRNone &)-3457N ST U V W XYZ[\ ]^     ]^Safe &)-3457Nboth Ascii and Utf8both Ascii and Utf8Safe &)-3457Nmay be omitted-if both Once and All are passed, All prevails$ wip Haystack !"#$%& !"#$%&&"#$% ! !"#$%&None &)-3457N *_ctr: constraint+see Regexdo.Pcre.Result for funs converting  to something useful,& returns the first occurrence - if any/tweak Regex with options3accepts  made with /4accepts  made with /5accepts regex _6accepts regex _7accepts regex `8this instance accepts regex `)matchTest (Needle "^ab") (Haystack "abc")True'()*+,-./012345678 '()*+,-./+,-./876543210*)'('()*+,-./012345678Safe &)-3457N: all matches;3extracts all values in a MatchArray (matched group)9:;9:;9:;9:;None &)-3457N<dynamic group replace,custom replacer fn returns replacement valuereplacer::GroupReplacer String' replacer = defaultReplacer 1 tweak1* where tweak1 str1 = case str1 of5 "101" -> "[AB> >48=]"0 "3" -> "[three]"; otherwise -> trace str1 "?" vs  optionsVreplaceGroup [Once,Utf8] (Needle "\\w=(\\d{1,3})", replacer) $ Haystack "a=101 b=3 12""a=[AB> >48=] b=3 12"UreplaceGroup [All,Utf8] (Needle "\\w=(\\d{1,3})", replacer) $ Haystack "a=101 b=3 12""a=[AB> >48=] b=[three] 12"+static replace for simple (no group) needleSreplace [Once,Utf8] (Needle "<5=55", Replacement "1>;55") $ Haystack "<5=55 <5=55" "1>;55 <5=55"Preplace [Once,Utf8] (Needle "^a\\s", Replacement "A") $ Haystack "a bc E>;.3>@.""Abc E>;.3>@." @Byou can write a custom replacer. This is only one common use case.@Replaces specified (by idx) group match with tweaked value. Aget group content safelycall from your custom & passed to >Bcall from your custom & passed to >see example replacer above <=>abcdefg?hij@ group idx"(group match -> replacement) tweakAklmBreplaced(new val, acc passed to &)new accnopqrst <=>?@AB <=>B@A?<=>abcdefg?hij@AklmBnopqrstNone &)-3457NC(front, end) : drop needle+break (Needle ":") (Haystack "0123:oid:90")("0123", "oid:90")*break (Needle "\n") (Haystack "a\nbc\nde")("a", "bc\nde") D(front, needle + end)/breakFront (Needle "\n") (Haystack "a\nbc\nde")("a", "\nbc\nde") E(front + needle, end)-breakEnd (Needle "\n") (Haystack "a\nbc\nde")("a\n", "bc\nde") F>replace (Needle "\n") (Replacement ",") (Haystack "a\nbc\nde")"a,bc,de" G*split (Needle "\n") (Haystack "a\nbc\nde")["a", "bc", "de"]'split (Needle " ") (Haystack "a bc de")["a", "bc", "de"].split (Needle "\\s") (Haystack "abc de fghi ")["abc de fghi "] H-splitEnd (Needle "\n") (Haystack "a\nbc\nde")["a\n", "bc\n", "de"] I/splitFront (Needle "\n") (Haystack "a\nbc\nde")["a", "\nbc", "\nde"] CDEFGHIuCDEFGHICDEFGHICDEFGHIu None &)-3457NL+pad String with Char to total length of Intpad '-' 5 "abc""--abc"v key basedkey may be {any string};format ">2G8=:0 {a} =5 {b}" [("a","2K45;:8"),("b","AB>8B")]">2G8=:0 2K45;:8 =5 AB>8B"w index based2format "=0 ?5@2>5 {0}, =0 2B>@>5 {0}" ["?5@;>2:0"]("=0 ?5@2>5 ?5@;>2:0, =0 2B>@>5 ?5@;>2:0"*format "Polly {0} a {1}" ["got","cracker"]"Polly got a cracker" xJKyz{L|}vwJKLLJK xJKyz{L|}vw None &)-3457NM/removes leading and trailing spaces and tabs MNOPMNMNPOMNOP~   !"#$%&'(())**++,-./0123456789:;<=>?@ABCDEFGHIJKLMENOP Q R S T U V WXYZ[\]^_`abcdefghijklmnopqrstuvwxy z{|}~  regex_4VpHXR8vQntAi7JMjnGQSzRegexdo.TypeRegexRegexdo.Pcre.ResultRegexdo.Pcre.OptionRegexdo.ConvertRegexdo.TypeDoRegexdo.Pcre.MatchRegexdo.Pcre.ReplaceRegexdo.SearchRegexdo.Format Regexdo.Trimregex_47KXx9dLqeO8MNJeizLKhPText.Regex.Base.RegexLike MatchArrayextractregex_D90DoxwgsTHEvoLrkciZPUText.Regex.PCRE.Wrap CompOption ExecOptionRegexExecBlankENotEmptyPartialCompBlankAnchoredCaselessDotall MultilineUtf8Ungreedycompexec toByteStringtoString ReplaceCaseOnceAllPosLen ReplacementHaystackNeedle ReplaceAcc acc_haystack position_adj GroupReplacerNeedle_r_ Match_opt Match_ctrMatch_clmatch matchTestmatchAll makeRegexOpts$fNeedle_Regex $fNeedle_[]$fNeedle_ByteString$fMatch_clRegexByteString$fMatch_clRegex[]$fMatch_clByteString[]$fMatch_clByteStringByteString$fMatch_cl[]ByteString$fMatch_cl[][]poslenvalue oneMatchArray Replace_clreplace replaceGroupMrdefaultReplacergetGroup replaceMatchbreak breakFrontbreakEndsplitsplitEnd splitFrontFormatformatpadTrimtrim$fTrim[]$fTrimByteStringRegexSRegexB execBlank execNotEmpty execPartial compBlank compAnchored compCaseless compDotAll compMultilinecompUTF8 compUngreedycompOptexecOptbytes_6VWy06pWzJq9evDvK2d4w6Data.ByteString.Internal ByteStringbaseGHC.BaseString Replace_cl'prefixsuffixconcat'len' toByteString'toAroncerall firstGroup adjustPoslen ronceGroup rallGroupaddOptisUtf8$fReplace_cl'ByteString$fReplace_clByteString$fReplace_cl'[]$fReplace_cl[] checkPattern $fFormat[] $fFormat[]0 CustomerFn foldFn_idx foldFn_map replaceOne foldr_idxfoldFn