r{      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTU V W X Y Z [ \ ] ^ _ ` a b c d e f g hijk l m n o p q r s t u v w x y z { | } ~  Safe&)-3457>LN+pad String with Char to total length of Int pad on leftpad '-' 5 "abc" "--abc"  pad on rightpad' '-' 5 "abc""abc--" None&)-3457>LNNone&)-3457>LN  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 the 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&)-3457>LNalloncevalues values"test: does body match pattern? !"#$%&'()  !"!" )('&%$#  !"#$%&'()Safe&)-3457>LN -2does not do any codec. Plain wrap / unwrap newtype1values2Offset, Length5Haystack7Needle;#content with some replacements made<Sposition adjustment: group replacement length may differ from replaced text length =see Text.Regex.Do.Pcre.ReplaceOpen defaultReplacer for example implementationA2does not do any codec. Plain wrap / unwrap newtype*+,-./0123456789:;<=>?@ABCDE*+,-./0123456789:;<=>=>9:;<E78D56C34B201A-./*+,@?*+,-./0123456789:;<=>?@ABCDESafe&)-3457>LNHboth Ascii and Utf8Jboth Ascii and Utf8FGHIJKLFGHIJHIJFGLKFGHIJKLNone&)-3457>LNtweak Regex with options MNOPQRSTMNOPQRSTPQRSTONM MNOPQRST None&)-3457>LNVneedle between parts disappearsW#needle sticks to front of next partX%needle sticks to end of previous partY;replace (Pattern "\n") (Replacement ",") (Body "a\nbc\nde")"a,bc,de" Z,break Drop (Pattern "\n") (Body "a\nbc\nde")("a", "bc\nde")-break Front (Pattern "\n") (Body "a\nbc\nde")("a", "\nbc\nde")+break End (Pattern "\n") (Body "a\nbc\nde")("a\n", "bc\nde") [)split Drop (Pattern " ") (Body "a bc de")["a", "bc", "de"]space may be used-split Front (Pattern "\n") (Body "a\nbc\nde")["a", "\nbc", "\nde"]+split End (Pattern "\n") (Body "a\nbc\nde")["a\n", "bc\n", "de"] UVWXYZ[UVWXYZ[ZY[UVWX UVWXYZ[ None&)-3457>LN 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" 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" \]\]\] \]Safe&)-3457>LNmatch offset, length all groupsmatches for one group None&)-3457>LN ^_`abcdmatched contentematched contentfg^_`abcde c^_`abgfde^_`abcdefgNone&)-3457>LNhi covers all result typesGcompiler looks up the appropriate function depending on the result typej is borrowed from Text.Regex.PCRE.Wrap, is a short version of i See also "Text.Regex.Do.Pcre.Ascii.MatchHint  match all match once#"" =~ "tourner gauche"::[PosLen] [(8,2)]  match all6"well" =~ "all is well that ends well"::[[ByteString]][["well"],["well"]] test"2" =~ "B8E> 2 ;5AC"::BoolTrue  match once""^all" =~ "all the time"::[String] ["all"] hijpatternbodyhijhijhij None&)-3457>LNkpicks h instance where 7 and 5 are of the same type and inferrable 7 or 5 type determine the instancehandy when working with OverloadedStrings-, in other cases when compiler needs a hint s'Test ("2"::ByteString) =~ "B8E> 2 ;5AC"True u'Once ("^all"::String) =~ "all the time"["all"] w(PosLen' ("8"::String) =~ "1K205B 8 EC65"[(13,2)] klmnhint & patternbody4type defined by the instance, determined by the hintopqrstuvwxklmnklmnxwvutsrqpo klmnopqrstuvwx Safe&)-3457>LNy<see String, ByteString instances for implementation examplessee Text.Regex.Base.RegexLike for  detail yz{|}~yz{|} yz{~|} yz{|}~Safe&)-3457>LN3:Sreplace (Just [(4,3)::PosLen]) (Replacement "4567") (Body "abc 123 def"::Body Text)"abc 4567 def"= :replacer::GroupReplacer TextJ replacer = defaultReplacer 1 tweak1 -- 1: first match in group* where tweak1 str1 = case str1 of2 "123" -> "[1-2-3]"? otherwise -> traceShow str1 "?"Qreplace (Just ([(4,3),(8,2)]::[PosLen])) replacer (Body "abc 123 def"::Body Text)"abc [1-2-3] def" dReplaces specified (by idx) group match with tweaked value. Works for one common simple use case=# can be used with complicated regexnanother custom dynamic replacer could e.g. inspect all group matches before looking up a replacement. get group content safelysee  source for use examplecall from your custom = passed to  replaceGroupsee  source for use example  group idx"(group match -> replacement) tweakreplaceable, unadjusted(new val, acc passed to =)new acc None&)-3457>LNto tweak regex with   or , see Text.Regex.Do.Type.Regexdynamic group replace2custom replacer fn returns replacement value. See replacer::GroupReplacer String' replacer = defaultReplacer 1 tweak1* where tweak1 str1 = case str1 of2 "101" -> "[1 0 1]". "3" -> "[ 3 ]"; otherwise -> trace str1 "?"Greplace (All (Pattern "\\w=(\\d{1,3})")) replacer $ Body "a=101 b=3 12""a=[1 0 1] b=[ 3 ] 12" +static replace for simple (no group) needle for no-regex  ByteString replacement see Text.Regex.Do.Split@replace (Once (Pattern "^a\\s")) (Replacement "A") (Body "a bc")"Abc"dynamic group replaceHreplace (Once (Pattern "\\w=(\\d{1,3})")) replacer $ Body "a=101 b=3 12""a=[1 0 1] b=3 12" None&)-3457>LNto tweak regex with Comp or Exec, see Text.Regex.Do.Type.Regexnote  Once_Utf8 and All_Utf8 hints *replacer::GroupReplacer (Utf8_ ByteString)+ replacer = defaultReplacer 1 tweak1+ where tweak1 bs1 = toByteString' $? if bs1 == toByteString' "]" then* "0S0". else "?"/runFn1 `shouldBe` toByteString "10000000S0b_0]" where runFn1 == let rx1 = Pattern $ toByteString' "(?<=0)(])"? body1 = Body $ toByteString' "1000000]b_0]"; in replace (All rx1) replacer body1  None&)-3457>LN match all match once4("8"::String) =~ ("1K205B 8 EC65"::String)::[PosLen] [(13,2)]  match allF("well"::String) =~ ("all is well that ends well"::String)::[[String]][["well"],["well"]] 4test. Note that a and b may be different types e.g.  and 1toByteString "2" =~ ("B8E> 2 ;5AC"::String)::Bool True  match onceZlet rx1 = makeRegexOpt' (Pattern $ toByteString' "]") [] [] -- add options as needed rx2 = Utf8_ <$> rx1L m1 = U.match rx2 (Body $ toByteString' "1000000]b_0]")::[ByteString]- m1 `shouldBe` [toByteString "]"] patternbody None&)-3457>LNpicks  instance where 7 and 5 are of the same type and inferrable 7 or 5 type determine the instancehandy when working with OverloadedStrings-, in other cases when compiler needs a hint 5Test (toByteString "2") =~ toByteString "B8E> 2 ;5AC"True 'Once ("^all"::String) =~ "all the time"["all"] (PosLen' ("8"::String) =~ "1K205B 8 EC65"[(13,2)]  hint patternbody4type defined by the instance, determined by the hint None&)-3457>LN/removes leading and trailing spaces and tabs  !"#$%&'()*+,-./011223344556789:;<=>?@ABCCDEEFFGGHHIJKKLMNOPQRSTUVWXYZ[\]^_` a b c d e f g h i j k l m n o p q r stuv w x u v y z { | } ~   eeetuvwxuv  regex_3KjBZqoKbcQEVRwwPtJvlWText.Regex.Do.Type.ReexportText.Regex.Do.Pcre.Ascii.MatchText.Regex.Do.PadText.Regex.Do.Pcre.OptionText.Regex.Do.Type.MatchHintText.Regex.Do.Type.DoText.Regex.Do.ConvertText.Regex.Do.Type.RegexText.Regex.Do.SplitText.Regex.Do.FormatText.Regex.Do.Pcre.Matchf"Text.Regex.Do.Pcre.Ascii.MatchHintText.Regex.Do.Type.ExtractText.Regex.Do.ReplaceOpen Text.Regex.Do.Pcre.Ascii.ReplaceText.Regex.Do.Pcre.Utf8.ReplaceText.Regex.Do.Pcre.Utf8.Match!Text.Regex.Do.Pcre.Utf8.MatchHintText.Regex.Do.TrimText.Regex.Do.Resultregex_47KXx9dLqeO8MNJeizLKhPText.Regex.Base.RegexLike MatchArrayextractregex_D90DoxwgsTHEvoLrkciZPUText.Regex.PCRE.Wrap CompOption ExecOptionRegexpadpad'ExecBlankENotEmptyPartialCompBlankAnchoredCaselessDotall MultilineUtf8UngreedycompexecHintunhinthintPosLen_PosLen'AllOnceTest$fApplicativeAll$fApplicativeOnce $fHintPosLen_ $fHintPosLen' $fHintAll $fHintOnce $fHintTestEnc'val'enc'EncvalencUtf8_PosLen ReplacementBodyPattern ReplaceAccaccpos_adj GroupReplacer$fEnc'GroupReplacerenc $fEncUtf8_$fApplicativeUtf8_$fApplicativeReplacement$fApplicativeBody$fApplicativePattern$fFunctorReplaceAccToArraytoArray toByteString toByteString'toString $fToArray[]$fToArrayArrayRo_Opt_Rx_ makeRegex makeRegexOpt makeRegex' makeRegexOpt' KeepNeedleDropFrontEndreplacebreaksplitFormatformatMatchfHPmarray_poslen_R_onceall $fMatchfAllb $fMatchfOncebMatchmatch=~ MatchHintF$fMatchHintAllByteString$fMatchHintOnceByteString$fMatchHintPosLen_ByteString$fMatchHintPosLen'ByteString$fMatchHintTestByteString$fMatchHintAll[]$fMatchHintOnce[]$fMatchHintPosLen_[]$fMatchHintPosLen'[]$fMatchHintTest[]Extract'concat'len'prefixsuffix$fExtract'Text $fExtractText$fExtract'Utf8_$fExtractUtf8_$fExtract'ByteString $fExtract'[] ReplaceOpendefaultReplacergetGroup replaceMatchRepl_ReplaceTrimtrim$fTrim[]$fTrimByteStringpad_RegexSRegexB execBlank execNotEmpty execPartial compBlank compAnchored compCaseless compDotAll compMultilinecompUTF8 compUngreedycompOptexecOpt makeRegexOpts $fRegexRegex $fRegex[]$fRegexByteString $fRegexUtf8_break' breakFrontbreakEndsplit'splitEnd splitFront checkPattern $fFormat[] $fFormat[]0 CustomerFn foldFn_idx foldFn_map replaceOne foldr_idxfoldFnposlen allMatches groupMatch $fMatchab[] $fMatchab[]0 $fMatchab[]1 $fMatchabBool $fMatchab[]2Extract firstGroup adjustPoslen$fReplaceOpen[]GroupReplacer$fReplaceOpenMaybeGroupReplacer$fReplaceOpen[]Replacement$fReplaceOpenMaybeReplacement$fReplaceAllareplb$fReplaceOnceareplbreplace_dum_ replace_bs'($fReplaceAllUtf8_ByteStringGroupReplacer replace_str replace_bs)$fReplaceOnceUtf8_ByteStringGroupReplacer&$fReplaceAllUtf8_ByteStringReplacement'$fReplaceOnceUtf8_ByteStringReplacement$fReplaceAllUtf8_[]Replacement$fReplaceOnceUtf8_[]Replacement$fMatchUtf8_ab[]$fMatchUtf8_ab[]0$fMatchUtf8_ab[]1$fMatchUtf8_abBoolbytes_6VWy06pWzJq9evDvK2d4w6Data.ByteString.Internal ByteStringbaseGHC.BaseString$fMatchUtf8_ab[]2mr_$fMatchHintTestUtf8_ByteString$fMatchHintOnceUtf8_[]$fMatchHintPosLen'Utf8_[]$fMatchHintAllUtf8_ByteString$fMatchHintOnceUtf8_ByteString!$fMatchHintPosLen_Utf8_ByteString!$fMatchHintPosLen'Utf8_ByteString$fMatchHintAllUtf8_[]$fMatchHintPosLen_Utf8_[]$fMatchHintTestUtf8_[]