!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  Safe*-29:;<=?DRTHaystacktest: does body match pattern? Safe*-29:;<=?DRT+pad String with Char to total length of Int pad on leftpad '-' 5 "abc" "--abc"  pad on rightpad' '-' 5 "abc""abc--" Safe*-29:;<=?DRT) String returns regex construction error Offset, Length #content with some replacements made Sposition adjustment: group replacement length may differ from replaced text length see Text.Regex.Do.Replace.Open defaultReplacer for example implementation     None*-29:;<=?DRTNone*-29:;<=?DRT Dclears default options: extended,caseSensitive,multiline regex An empty string is not considered to be a valid match if this option is set. If there are alternatives in the pattern, they are tried. If all the alternatives match the empty string, the entire match fails. For example, if the patterna?b?is applied to a string not beginning with "a" or "b", it matches an empty string at the start of the subject. With PCRE_NOTEMPTY set, this match is not valid, so PCRE searches further into the string for occurrences of "a" or "b". see PCREPARTIAL(3) in  http://www.pcre.org/pcre.txtpcre man pages  http://www.pcre.org/pcre.txtpcre man pages>clears default options: extended,caseSensitive,multiline regexthe pattern is forced to be "anchored", that is, it is constrained to match only at the first matching point in the string that is being searched (the "subject string").TThis effect can also be achieved by appropriate constructs in the pattern itself. Bletters in the pattern match both upper and lower case letters.jIt is equivalent to Perl's /i option, and it can be changed within a pattern by a (?i) option setting.In UTF-8 mode, PCRE always understands the concept of case for characters whose values are less than 128, so caseless matching is always possible. For characters with higher values, the concept of case is supported if PCRE is compiled with Unicode property support. If you want to use caseless matching for characters 128 and above, you must ensure that PCRE is compiled with Unicode property support as well as with UTF-8 support. ya dot metacharacter in the pattern matches a character of any value, including one that indicates a newline.SHowever, it only ever matches one character, even if newlines are coded as CRLF.\Without this option, a dot does not match when the current position is at a newline.pThis option is equivalent to Perl's /s option, and it can be changed within a pattern by a (?s) option setting.lA negative class such as [^a] always matches newline characters, independent of the setting of this option. By default, for the purposes of matching "start of line" and "end of line", PCRE treats the subject string as consisting of a single line of characters, even if it actually contains newlines. The "start of line" metacharacter (^) matches only at the start of the string, and the "end of line" metacharacter ($) matches only at the end of the string, or before a terminating newline (except when PCRE_DOLLAR_ENDONLY is set). Note, however, that unless PCRE_DOTALL is set, the "any character" metacharacter (.) does not match at a newline. This behaviour (for ^, $, and dot) is the same as Perl.When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs match immediately following or immediately before internal newlines in the subject string, respectively, as well as at the very start and end.oThis is equivalent to Perl's /m option, and it can be changed within a pattern by a (?m) option setting.If there are no newlines in a subject string, or no occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. This option causes PCRE to regard both the pattern and the subject as strings of UTF-8 characters instead of single-byte strings. However, it is available only when PCRE is built to include UTF support. If not, the use of this option provokes an error. Details of how this option changes the behaviour of PCRE are given in the pcreunicode page. This option inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by "?".AIt can also be set by a (?U) option setting within the pattern. Safe*-29:;<=?DRT% replace all' replace once$%&'$%&'$%&'None*-29:;<=?DRT $%&' &'$%None*-29:;<=?DRTcatches regex construction errors  internal type ()*+,-./()*()* ()*+,-./None*-29:;<=?DRT1<see String, ByteString instances for implementation examplessee Text.Regex.Base.RegexLike for  detail 12345678913245 123987645123456789None*-29:;<=?DRTmatch offset, length all groupsmatches for one groupNone*-29:;<=?DRTmatched contentmatched contentmatched content  None*-29:;<=?DRT :keep needle @ end<keep needle @ front>slices . drops needleto avoid clash with Prelude: import Prelude hiding((/)) or qualify ?A with alias e.g. (assuming this module is imported with S alias): S./body -> pattern -> result@Split result: listABreak result: tupleB"a\nbc\nde" /- "\n"["a\n", "bc\n", "de"] C"a\nbc\nde" -/ "\n"["a", "\nbc", "\nde"] D)"a bc de" / " " -- space may be used["a", "bc", "de"] E"a\nbc\nde" /- "\n"("a\n", "bc\nde") F"a\nbc\nde" -/ "\n"("a", "\nbc\nde") G"a\nbc\nde" / "\n"("a", "bc\nde") :;<=>?@ABCDEFG:;<=>?@A>?<=:;A@ :;<=>?@ABCDEFGNone*-29:;<=?DRTHreplace "\n" "," "a\nbc\nde""a,bc,de" HPattern  ReplacementBodyHHHNone*-29:;<=?DRT I pattern: ,  ByteString, body: ,  ByteStringout: out | E out[[]][[ ByteString]][[ ]]K API changes: Once is hinted with L All is hinted with J 9All regex-computing instances catch regex errors, return   out ( String is the error message) pattern: ,  ByteString, .String | ByteString pattern may contains regexbody: ,  ByteStringout: out | E out: test if regex matches[][ ByteString][ ]2precompiled Regex may be used as pattern too. see Text.Regex.Do.Match.Utf8 Nalways succeeds O%"" ~? "tourner gauche"::E [PosLen]Right [(8,2)] Palways succeeds Q j"chilly" ~* "it's chilly inside, chilly outside"::E [[ByteString]] Right [["chilly"],["chilly"]] Ralways succeeds Stest.always succeeds Ttest8"chilly" ~? "it's chilly inside, chilly outside"::E BoolRight True U$"^all" ~? "all the time"::E [String]Right ["all"] Valways succeeds IJKLMNOPQRSTUVIJKLKLIJIJKLMNOPQRSTUV Safe*-29:;<=?DRTYboth Ascii and Utf8Zboth Ascii and Utf8WXYZ[\WXYZYZWX\[WXYZ[\ None*-29:;<=?DRT_tReplaces specified (by idx) group match with value provided by (a -> a) fn. Works for one common simple use case( can also be used with multi-group regexnanother custom dynamic replacer could e.g. inspect all group matches before looking up a replacement. `)check if specified group index is within  boundsfor use within aget group content safely:1non-existing group idx will not error but return 'adjust for previous replacements lengthsee _ source for use examplebDreplace group match while adjusting for previous replacements lengthsee _ source for use example ]^_*group idx. 0: full match, groups: 1.. see #(group match -> replacement) lookup`abreplaceable, unadjusted(new val, acc passed to )new acccdef]^_`ab]^_ab` ]^_`abcdef None*-29:;<=?DRTghint: $ | & pattern: , ,  ByteString .String | ByteString pattern may contains regexbody: ,  ByteString result is  String body: - String returns regex construction errors. ib:  |  ByteStringjb:  |  ByteStringkb:  |  ByteStringlb:  |  ByteStringmsucceeds unless % fails due to mismatched pattern etc repl:  |  ByteString |  replnsucceeds unless % fails due to mismatched pattern etc repl:  |  ByteString |  repl ghijklmnghgh ghijklmn None*-29:;<=?DRTosee Text.Regex.Do.Replace.Latin for implemented types is implemented only for  q replacer::GroupReplacer ByteString replacer = defaultReplacer 1 tweak1 where tweak1 bs1 = toByteString' $ if bs1 == toByteString "]" then "0S0" else "?" runFn1 `shouldBe` toByteString "10000000S0b_0]" where runFn1 = let rx1 = toByteString "(?<=0)(])" body1 = toByteString "1000000]b_0]" in replace (All rx1) replacer body1 wsucceeds unless % fails due to mismatched pattern etc repl:  |   xsucceeds unless % fails due to mismatched pattern etc repl:  |   yalways succeedszalways succeedsopqrstuvwxyzopop opqrstuvwxyz None*-29:;<=?DRT|implemented a: a: template e.g. "today is {0}"!repl: replacement: [a] or [(a,a)] key basedkey may be {any a}6">2G8=:0 {a} =5 {b}" < [("a","2K45;:8"),("b","AB>8B")]">2G8=:0 2K45;:8 =5 AB>8B" index based.["F25BK", "<>@>65=>5"] > "40<5 {0}, 45BO< {1}""40<5 F25BK, 45BO< <>@>65=>5"'"Polly {0} a {1}" < ["wants","cracker"]"Polly wants a cracker"-["?5@;>2:0"] > "=0 ?5@2>5 {0}, =0 2B>@>5 {0}"("=0 ?5@2>5 ?5@;>2:0, =0 2B>@>5 ?5@;>2:0"{|}~{|~}|}~{{|}~None*-29:;<=?DRT  pattern: , ,  compile  with  optbody: , out:[[]][[]][[ ]]  pattern: , ,  compile  with  opt.String | ByteString pattern may contains regexbody: , out: out | E out : test if regex matches[] [][ ] b: ,  always succeeds >(";5A"::String) ~* ("0;5ALN, 70;5ALN &"::String)::E [[String]]Right [[";5A"],[";5A"]] b: ,  always succeeds test0("2"::String) ~? ("B8E> 2 ;5AC"::String)::E BoolRight True .("^q"::String) ~? ("q0DSH_"::String)::E [String]Right ["q"] b: ,  always succeeds b: ,  always succeeds b: ,  always succeeds precompiled regex as pattern let Right rx1 = makeRegexOpt (toByteString "]") [Utf8] [] -- add options as needed m1 = rx1 ~? (toByteString "1000000]b_0]")::[ByteString] m1 shouldBe [toByteString "]"] None*-29:;<=?DRT/removes leading and trailing spaces and tabs see  !"##$%&&'()*+,-./0123456789:;;<<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij k l m n o p q \ r s t u v w x y q \ z { | } ~  q \    ]^_`bfdgj   #regex-do-3.2-DYYj0u8XyaJHazfoNoy4aMText.Regex.Do.Type.DoText.Regex.Do.Match.LatinText.Regex.Do.PadText.Regex.Do.Match.OptionText.Regex.Do.Match.RegexText.Regex.Do.Type.ExtractText.Regex.Do.SplitText.Regex.Do.Replace.FastText.Regex.Do.Type.ConvertText.Regex.Do.Replace.OpenText.Regex.Do.Replace.LatinText.Regex.Do.Replace.Utf8Text.Regex.Do.Replace.TemplateText.Regex.Do.Match.Utf8Text.Regex.Do.TrimText.Regex.Do.Type.InternalText.Regex.Do.Type.Do_Text.Regex.Do.Type.ReexportText.Regex.Do.Type.MatchHintText.Regex.Do.Match.ResultText.Regex.Do.Match.Matchf(regex-base-0.93.2-71isvdwnRNrGKtKYo9rpQdText.Regex.Base.RegexLike MatchArrayextract'regex-pcre-0.94.4-6aXlOKXpmCVUPAmJcaj8JText.Regex.PCRE.Wrap CompOption ExecOptionRegexpadpad'EPosLen ReplaceAccaccpos_adj GroupReplacerExecBlankENotEmptyPartialCompBlankAnchoredCaselessDotall MultilineUtf8Ungreedycompexec$fEqComp $fOrdComp $fEnumComp$fEqExec $fOrdExec $fEnumExecAllOnce makeRegex makeRegexOpt$fMonadRegexResult$fApplicativeRegexResult $fRegexRegex $fRegex[]$fRegexByteString$fFunctorRegexResultExtract'concat'len'prefixsuffix$fExtract'Text $fExtractText$fExtract'ByteString $fExtract'[]SplitEnd/- SplitFront-/Split/LT $fSplitEnd[]$fSplitFront[] $fSplit[] $fSplitEnd(,)$fSplitFront(,) $fSplit(,)replaceMatchAll~* MatchOnce~?$fMatchAllbbEither$fMatchAllRegexb[]$fMatchOncebbEither$fMatchOnceRegexb[]$fMatchAllbbEither0$fMatchAllRegexb[]0$fMatchOnceRegexbBool$fMatchOncebbEither0$fMatchOncebbEither1$fMatchOnceRegexb[]0ToArraytoArray toByteStringtoString $fToArray[]$fToArrayArrayReplacedefaultReplacerboundsOkgetGroup replaceMatch$fReplace[]GroupReplacerb$fReplaceMaybeGroupReplacerb $fReplace[]bb$fReplaceMaybebb!$fReplaceAllbGroupReplacerbEither$fReplaceAllbbbEither"$fReplaceOncebGroupReplacerbEither$fReplaceOncebbbEither$fReplaceAllRegexreplbb$fReplaceOnceRegexreplbb3$fReplaceAllByteStringGroupReplacerByteStringEither4$fReplaceOnceByteStringGroupReplacerByteStringEither0$fReplaceAllByteStringByteStringByteStringEither1$fReplaceOnceByteStringByteStringByteStringEither$fReplaceAll[][][]Either$fReplaceOnce[][][]Either)$fReplaceAllRegexreplByteStringByteString*$fReplaceOnceRegexreplByteStringByteString$fReplaceAllRegex[][][]$fReplaceOnceRegex[][][] ReplaceOneTemplate<> Formatable$fReplaceOneTextText$fReplaceOneIntText $fReplaceOneByteStringByteString$fReplaceOneIntByteString$fReplaceOne[][]$fReplaceOneInt[] $fTemplatea[]$fTemplatea[]0$fWithRegex[]BoolBool$fWithRegex[][][]$fWithRegex[][][]0$fWithRegexByteStringoutout$$fMatchAllByteStringByteStringEither$fMatchAll[][]Either$fMatchAll[][]Either0%$fMatchAllByteStringByteStringEither0$fMatchOnce[][]Either%$fMatchOnceByteStringByteStringEither&$fMatchOnceByteStringByteStringEither0$fMatchOnce[][]Either0&$fMatchOnceByteStringByteStringEither1$fMatchOnce[][]Either1Trimtrim $fTrimText$fTrim[]$fTrimByteStringBodyTestHintunhinthint$fApplicativeBody $fHintTestpad_base Data.EitherLeft$fFunctorReplaceAccRegexSRegexB execBlank execNotEmpty execPartial compBlank compAnchored compCaseless compDotAll compMultilinecompUTF8 compUngreedycompOptexecOpt$fApplicativeAll$fApplicativeOnce $fHintAll $fHintOnce RegexResultOpt_makeRegexOptsMrreExtractposlen allMatches groupMatchMatchfHPmarray_poslen_R_oncealltesttagOncetagAll checkPattern$fMatchfTagged$fMatchfTagged0bytestring-0.10.8.1Data.ByteString.Internal ByteStringGHC.BaseStringEitherghc-prim GHC.TypesBool withRegex withRegex'Nothing firstGroup adjustPoslen replace_rxreplace_ replace_str replace_bs#text-1.2.2.1-9Yh8rJoh8fO2JMLWffT3QsData.Text.InternalText replaceOne CustomerFn foldFn_idx foldFn_map foldr_idxfoldFn WithRegex Data.Textstrip