v      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF G H I J K L M N O P Q R S T U V W XYZ[\ ] ^ _ ` a b c d e f g h i j k l m n opqrstuSafe &)-3457N all once valuesvaluestest: does body match pattern?         Safe &)-3457N+pad String with Char to total length of Int pad on leftpad '-' 5 "abc" "--abc"  pad on rightpad' '-' 5 "abc""abc--" vvNone &)-3457NwxwxNone &)-3457N yzAn 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.  !"#$%& !"#$%& !"#$%& !"#$%&None &)-3457N)may be omitted*-if both Once and All are passed, All prevails-Offset, Length0Haystack2Needle6#content with some replacements made7Sposition adjustment: group replacement length may differ from replaced text length 8see Text.Regex.Do.Pcre.ReplaceOpen defaultReplacer for example implementation'()*+,-./0123456789'()*+,-./01234567898945672301./-()*+,''()*+,-./0123456789None &)-3457N<both Ascii and Utf8=both Ascii and Utf8:;<=>?:;<=<=:;?>:;<=>?None &)-3457N@ABCDE@ABABEDC@@ABCDE None &)-3457NF<see String, ByteString instances for implementation examplessee Text.Regex.Base.RegexLike for  detail FGHIJKLMNFGHIJ FGHNMLKIJFGHIJKLMN None &)-3457NPneedle between parts disappearsQ#needle sticks to front of next partR%needle sticks to end of previous partS;replace (Pattern "\n") (Replacement ",") (Body "a\nbc\nde")"a,bc,de" T,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") U)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"] OPQRSTUOPQRSTUTSUOPQR OPQRSTU None &)-3457N 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" VWVWVW VWNone &)-3457Nmatch offset, length all groupsmatches for one groupNone &)-3457Nmatched contentmatched contentNone &)-3457NXY covers all result typesGcompiler looks up the appropriate function depending on the result typeZ is borrowed from Text.Regex.PCRE.Wrap, is a short version of Y See also Text.Regex.Do.Pcre.MatchHint [tweak Regex with options match all match once "8" =~ "1K205B 8 EC65"::[PosLen][(13,2)]Utf8Text.Regex.Do.Pcre.MatchHint  match all6"well" =~ "all is well that ends well"::[[ByteString]][["well"],["well"]]Text.Regex.Do.Pcre.MatchHint test"2" =~ "B8E> 2 ;5AC"::BoolTrueText.Regex.Do.Pcre.MatchHint  match once""^all" =~ "all the time"::[String]["all"]Text.Regex.Do.Pcre.MatchHint XYZpatternbody[XYZ[XYZ[XYZ[ None&)-3457>LN\picks X instance where 2 and 0 are of the same type and inferrable 2 or 0 type determine the instancehandy when working with OverloadedStrings+, in other cases when compiler needs a hint'Test ("2"::ByteString) =~ "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`abcdefghi\]^_\]^_ihgfedcba` \]^_`abcdefghi None &)-3457Nj.:Sreplace (Just [(4,3)::PosLen]) (Replacement "4567") (Body "abc 123 def"::Body Text)"abc 4567 def"8 :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" ldReplaces specified (by idx) group match with tweaked value. Works for one common simple use case8# can be used with complicated regexnanother custom dynamic replacer could e.g. inspect all group matches before looking up a replacement. mget group content safelysee l source for use examplencall from your custom 8 passed to  replaceGroupsee l source for use example jkl group idx"(group match -> replacement) tweakmnreplaceable, unadjusted(new val, acc passed to 8)new accjklmnjklmn jklmnNone &)-3457No%implementation detail for the curiousqdynamic group replace2custom replacer fn returns replacement value. See lreplacer::GroupReplacer String' replacer = defaultReplacer 1 tweak1* where tweak1 str1 = case str1 of5 "101" -> "[AB> >48=]"0 "3" -> "[three]"; otherwise -> trace str1 "?") vs * optionsMreplace [Once,Utf8] (Pattern "\\w=(\\d{1,3})") replacer $ Body "a=101 b=3 12""a=[AB> >48=] b=3 12"Lreplace [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) needle for no-regex  replacement see Text.Regex.Do.SplitQreplace [Once,Utf8] (Pattern "<5=55") (Replacement "1>;55") $ Body "<5=55 <5=55" "1>;55 <5=55"Nreplace [Once,Utf8] (Pattern "^a\\s") (Replacement "A") $ Body "a bc E>;.3>@.""Abc E>;.3>@." opqopqqop opqNone &)-3457Nr/removes leading and trailing spaces and tabs rstursrsutrstu  !!"#$%&'()*+,-./012345678 329::;;<<==>?@@ABCDEFGHIJKL M N O P Q R S T U V W X Y Z [ \ ] ^_`ab c d ` a e f g h i j k l m n o Z p q rstZuvwxyz{|}~   5regex_BGBb4HGxns5Efgr9u9RsnoText.Regex.Do.Type.ReexportText.Regex.Do.Pcre.MatchText.Regex.Do.Type.MatchHintText.Regex.Do.PadText.Regex.Do.Pcre.OptionText.Regex.Do.Type.DoText.Regex.Do.ConvertText.Regex.Do.Type.Regex_Text.Regex.Do.Type.ExtractText.Regex.Do.SplitText.Regex.Do.FormatText.Regex.Do.Pcre.MatchHintText.Regex.Do.Pcre.ReplaceOpenText.Regex.Do.Pcre.ReplaceText.Regex.Do.TrimText.Regex.Do.Pcre.ResultText.Regex.Do.Pcre.Matchfregex_47KXx9dLqeO8MNJeizLKhPText.Regex.Base.RegexLike MatchArrayextractregex_D90DoxwgsTHEvoLrkciZPUText.Regex.PCRE.Wrap CompOption ExecOptionRegexHintunhintPosLen_PosLen'AllOnceTest $fHintPosLen_ $fHintPosLen' $fHintAll $fHintOnce $fHintTestpadpad'ExecBlankENotEmptyPartialCompBlankAnchoredCaselessDotall MultilineUtf8UngreedycompexecOpt_ ReplaceCasePosLen ReplacementBodyPattern ReplaceAccaccpos_adj GroupReplacerToArraytoArray toByteStringtoString $fToArray[]$fToArrayArrayRx_Regex_r_ $fRegex_Regex $fRegex_[]$fRegex_ByteStringExtract'concat'len'prefixsuffix$fExtract'Text $fExtractText$fExtract'ByteString $fExtract'[] KeepNeedleDropFrontEndreplacebreaksplitFormatformatMatchmatch=~ makeRegexOpts MatchHintF$fMatchHintAllByteString$fMatchHintOnceByteString$fMatchHintPosLen_ByteString$fMatchHintPosLen'ByteString$fMatchHintTestByteString$fMatchHintAll[]$fMatchHintOnce[]$fMatchHintPosLen_[]$fMatchHintPosLen'[]$fMatchHintTest[] ReplaceOpendefaultReplacergetGroup replaceMatch ReplaceCase_replace_Trimtrim$fTrim[]$fTrimByteStringpad_RegexSRegexB execBlank execNotEmpty execPartial compBlank compAnchored compCaseless compDotAll compMultilinecompUTF8 compUngreedycompOptexecOptExtractbreak' breakFrontbreakEndsplit'splitEnd splitFront checkPattern $fFormat[] $fFormat[]0 CustomerFn foldFn_idx foldFn_map replaceOne foldr_idxfoldFnposlen allMatches groupMatchMatchfmarray_poslen_onceall $fMatchf[]ab$fMatchfMaybeab $fMatchab[] $fMatchab[]0 $fMatchab[]1 $fMatchabBool $fMatchab[]2 firstGroup adjustPoslen$fReplaceOpen[]GroupReplacer$fReplaceOpenMaybeGroupReplacer$fReplaceOpen[]Replacement$fReplaceOpenMaybeReplacementbytes_6VWy06pWzJq9evDvK2d4w6Data.ByteString.Internal ByteStringvanilla_replaceaddOpt$fReplaceCase_GroupReplacer[]%$fReplaceCase_GroupReplacerByteString#$fReplaceCase_ReplacementByteString$fReplaceCase_Replacement[]