-      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ [\]^_`abcdefghi j k l m n o p q r s t u v w x y z { | } ~  Safe*-29:;<=?DRT+pad String with Char to total length of Int pad on leftpad '-' 5 "abc" "--abc"  pad on rightpad' '-' 5 "abc""abc--" None*-29:;<=?DRTSafe*-29:;<=?DRT) String returns regex construction error Offset, LengthHaystack #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        Safe*-29:;<=?DRT<see String, ByteString instances for implementation examplessee Text.Regex.Base.RegexLike for  detail  Safe*-29:;<=?DRTmatch offset, length all groupsmatches for one groupNone*-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.  !"#$%&# !"$%& !"#$%& !"#$%&None*-29:;<=?DRTcatches regex construction errors  internal type -./01234-./-./ -./01234Safe*-29:;<=?DRT:all<once> replace all@ replace onceBtest: does body match pattern?6789:;<=>?@ABCDEFGHI 6879:;<=>?@ABAB?@=>;<9:678IHGFEDC 6789:;<=>?@ABCDEFGHINone*-29:;<=?DRTmatched contentmatched contentmatched content  None*-29:;<=?DRT Lkeep needle @ endNkeep needle @ frontPslices . drops needleto avoid clash with Prelude: import Prelude hiding((/)) or qualify QA with alias e.g. (assuming this module is imported with S alias): S./body -> pattern -> resultRSplit result: listSBreak result: tupleT"a\nbc\nde" /- "\n"["a\n", "bc\n", "de"] U"a\nbc\nde" -/ "\n"["a", "\nbc", "\nde"] V)"a bc de" / " " -- space may be used["a", "bc", "de"] W"a\nbc\nde" /- "\n"("a\n", "bc\nde") X"a\nbc\nde" -/ "\n"("a", "\nbc\nde") Y"a\nbc\nde" / "\n"("a", "bc\nde") LMNOPQRSTUVWXYLMNOPQRSPQNOLMSR LMNOPQRSTUVWXY None*-29:;<=?DRTZreplace "\n" "," "a\nbc\nde""a,bc,de" ZPattern  ReplacementBodyZZZNone*-29:;<=?DRT [ pattern: ,  ByteString, -body: ,  ByteStringout: out | E out[[]][[ ByteString]][[]]] API changes: Once is hinted with ^ All is hinted with \ 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 `always succeeds a%"" ~? "tourner gauche"::E [PosLen]Right [(8,2)] balways succeeds c j"chilly" ~* "it's chilly inside, chilly outside"::E [[ByteString]] Right [["chilly"],["chilly"]] dalways succeeds etest.always succeeds ftest8"chilly" ~? "it's chilly inside, chilly outside"::E BoolRight True g$"^all" ~? "all the time"::E [String]Right ["all"] halways succeeds [\]^_`abcdefgh[\]^]^[\[\]^_`abcdefgh Safe*-29:;<=?DRTkboth Ascii and Utf8lboth Ascii and Utf8ijklmnijklklijnmijklmn Safe*-29:;<=?DRTqtReplaces 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. rget group content safely:1non-existing group idx will not error but return 'adjust for previous replacements lengthsee q source for use examplesDreplace group match while adjusting for previous replacements lengthsee q source for use example opqgroup idx. 1-based#(group match -> replacement) lookuprsreplaceable, unadjusted(new val, acc passed to  )new acctuvwopqrsopqrs opqrstuvw None*-29:;<=?DRTxhint: = | ? pattern: , ,  ByteString .String | ByteString pattern may contains regexbody: ,  ByteString result is  String body: - String returns regex construction errors. zb:  |  ByteString{b:  |  ByteString|b:  |  ByteString}b:  |  ByteString~succeeds unless  % fails due to mismatched pattern etc repl:  |  ByteString |   replsucceeds unless  % fails due to mismatched pattern etc repl:  |  ByteString |   repl xyz{|}~xyxy xyz{|}~ None*-29:;<=?DRTsee Text.Regex.Do.Replace.Latin for implemented types  is implemented only for  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 succeeds unless  % fails due to mismatched pattern etc repl:  |    succeeds unless  % fails due to mismatched pattern etc repl:  |    always succeedsalways succeeds None*-29:;<=?DRTimplemented 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-["?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"%"Polly {0} a {1}" < ["got","cracker"]"Polly got a cracker"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:;<=>?@ABCDEFGHIJKLLMMNNOOPPQRSTUVWXYZ[\]^_`abcdefg hijklmnopqrstuv w x y z { | } h ~  } h } h ijklnrpsv@ #regex-do-3.0-KeEjVyUFlPvCSiAJsEWGjpText.Regex.Do.Match.LatinText.Regex.Do.PadText.Regex.Do.Type.DoText.Regex.Do.Type.ExtractText.Regex.Do.Match.OptionText.Regex.Do.Match.RegexText.Regex.Do.Type.MatchHintText.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.ReexportText.Regex.Do.Match.ResultText.Regex.Do.Match.Matchf(regex-base-0.93.2-71isvdwnRNrGKtKYo9rpQdText.Regex.Base.RegexLikeextractpadpad'EPosLenBody ReplaceAccaccpos_adj GroupReplacer$fApplicativeBody$fFunctorReplaceAcc $fFunctorBodyExtract'concat'len'prefixsuffix$fExtract'Text $fExtractText$fExtract'ByteString $fExtract'[]ExecBlankENotEmptyPartialCompBlankAnchoredCaselessDotall MultilineUtf8Ungreedycompexec$fEqComp $fOrdComp $fEnumComp$fEqExec $fOrdExec $fEnumExecRegex makeRegex makeRegexOpt$fMonadRegexResult$fApplicativeRegexResult $fRegexRegex $fRegex[]$fRegexByteString$fFunctorRegexResultHintunhinthintPosLen_PosLen'AllOnceTest$fApplicativeAll$fApplicativeOnce $fHintPosLen_ $fHintPosLen' $fHintAll $fHintOnce $fHintTest $fFunctorOnce $fFunctorAllSplitEnd/- 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[]$fToArrayArrayReplacedefaultReplacergetGroup 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[]$fTrimByteStringpad_RegexSRegexB MatchArray'regex-pcre-0.94.4-6aXlOKXpmCVUPAmJcaj8JText.Regex.PCRE.Wrap CompOption ExecOptionbase Data.EitherLeftExtractposlen allMatches groupMatch execBlank execNotEmpty execPartial compBlank compAnchored compCaseless compDotAll compMultilinecompUTF8 compUngreedycompOptexecOpt RegexResultOpt_makeRegexOptsMrreMatchfHPmarray_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