Di=Q      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ K L M N O P None &)-3457NQRQRNone &)-3457N ST U V W XYZ[\ ]^     ]^Safe &)-3457Nboth Ascii and Utf8both Ascii and Utf8None &)-3457Nmay be omitted-if both Once and All are passed, All prevailsOffset, LengthHaystack!Needle% Body with some replacements made&Sposition adjustment: group replacement length may differ from replaced text length  !"#$%&' !"#$%&''#$%&!"  !"#$%&'None &)-3457N+see Text.Regex.Do.Pcre.Result to convert  to something useful/tweak Regex with options3accepts  made with /4accepts  made with /5accepts regex _6accepts regex _7accepts regex `8accepts regex `&matchTest (Pattern "^ab") (Body "abc")True()*+,-./012345678()*+,-./+,-./876543)*210( ()*+,-./012345678None &)-3457N9match offset, length: all groups;matches for one group9:;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  optionsSreplaceGroup [Once,Utf8] (Pattern "\\w=(\\d{1,3})", replacer) $ Body "a=101 b=3 12""a=[AB> >48=] b=3 12"RreplaceGroup [All,Utf8] (Pattern "\\w=(\\d{1,3})", replacer) $ Body "a=101 b=3 12""a=[AB> >48=] b=[three] 12"+static replace for simple (no group) needlePreplace [Once,Utf8] (Pattern "<5=55", Replacement "1>;55") $ Body "<5=55 <5=55" "1>;55 <5=55"Mreplace [Once,Utf8] (Pattern "^a\\s", Replacement "A") $ Body "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) tweakAklmBreplaceable, unadjusted(new val, acc passed to ')new accnopqrst <=>?@AB =>?B@A<<abcdefg=>?hij@AklmBnopqrstNone &)-3457NC(front, end) : drop needle(break (Pattern ":") (Body "0123:oid:90")("0123", "oid:90")'break (Pattern "\n") (Body "a\nbc\nde")("a", "bc\nde") D(front, needle + end),breakFront (Pattern "\n") (Body "a\nbc\nde")("a", "\nbc\nde") E(front + needle, end)*breakEnd (Pattern "\n") (Body "a\nbc\nde")("a\n", "bc\nde") F;replace (Pattern "\n") (Replacement ",") (Body "a\nbc\nde")"a,bc,de" G'split (Pattern "\n") (Body "a\nbc\nde")["a", "bc", "de"]$split (Pattern " ") (Body "a bc de")["a", "bc", "de"]+split (Pattern "\\s") (Body "abc de fghi ")["abc de fghi "] H*splitEnd (Pattern "\n") (Body "a\nbc\nde")["a\n", "bc\n", "de"] I,splitFront (Pattern "\n") (Body "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:;<=>?@ABCDEFGHIJKLMFNOP Q R S T U V WXYZ[\]^_`abcdefghijklmnopqrstuvwxy z{|}~  regex_6rdszUNJJ0QAzMHEmcMKK2Text.Regex.Do.TypeRegexText.Regex.Do.Pcre.ResultText.Regex.Do.Pcre.OptionText.Regex.Do.ConvertText.Regex.Do.TypeDoText.Regex.Do.Pcre.MatchText.Regex.Do.Pcre.ReplaceText.Regex.Do.SplitText.Regex.Do.FormatText.Regex.Do.Trimregex_47KXx9dLqeO8MNJeizLKhPText.Regex.Base.RegexLike MatchArrayextractregex_D90DoxwgsTHEvoLrkciZPUText.Regex.PCRE.Wrap CompOption ExecOptionRegexExecBlankENotEmptyPartialCompBlankAnchoredCaselessDotall MultilineUtf8Ungreedycompexec toByteStringtoStringOpt_ ReplaceCaseOnceAllPosLen ReplacementBodyPattern ReplaceAccaccpos_adj GroupReplacerRx_Regex_r_Match matchOnce matchTestmatchAll makeRegexOpts $fRegex_Regex $fRegex_[]$fRegex_ByteString$fMatchRegexByteString$fMatchRegex[]$fMatchByteString[]$fMatchByteStringByteString$fMatch[]ByteString $fMatch[][]poslen allMatches groupMatchMr_Replacereplace replaceGroupdefaultReplacergetGroup replaceMatchbreak breakFrontbreakEndsplitsplitEnd splitFrontFormatformatpadTrimtrim$fTrim[]$fTrimByteStringRegexSRegexB execBlank execNotEmpty execPartial compBlank compAnchored compCaseless compDotAll compMultilinecompUTF8 compUngreedycompOptexecOptbytes_6VWy06pWzJq9evDvK2d4w6Data.ByteString.Internal ByteStringbaseGHC.BaseStringReplace_prefixsuffixconcat'len' toByteString'toAroncerall firstGroup adjustPoslen ronceGroup rallGroupaddOptisUtf8$fReplace_ByteString $fReplace_[]$fReplaceByteString $fReplace[] checkPattern $fFormat[] $fFormat[]0 CustomerFn foldFn_idx foldFn_map replaceOne foldr_idxfoldFn