u      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                      ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ 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 [ \ ] ^_`abcdefghijklmnopqrstuvwxyz{|}~      /Safe/contains a compiled RE and replacement template#the RE to match a string to replacekthe replacement template with ${cap} used to identify a capture (by number or name if one was given) and $$ being used to escape a single NoneI2our line numbers are of the proper zero-based kindthe first line in a file*extract a conventional 1-based line number )inject a conventional 1-based line number   NoneI a  t is just the number of the capture, starting with 0 for the whole of the text matched, then in leftmost, outermost a   is just the text of the nameTthe dictionary for named captures stored in compiled regular expressions associates[CaptureID identifies captures, either by number (e.g., [cp|1|]) or name (e.g., [cp|foo|]). an empty  dictionary look up a  in the  dictionary    Safe!"09;<=Hthe matching of a single sub-expression against part of the source text the whole text that was searchedthe text that was matchedythe number of characters preceding the match with -1 used if no text was captured by the RE (not even the empty string)1the number of chacter in the captured sub-string(test if the capture has matched any text$returns the text preceding the match returns the text after the match  None!"09;<=1the result of matching a RE to a text once (with ?=~/), retaining the text that was matched against!the whole source text"the RE's capture names# @.n-1 captures, starting with the text matched by the whole RE$/Construct a Match that does not match anything.%an empty array of Capture&3tests whether the RE matched the source text at all'6yields the text matched by the RE, Nothing if no match(Kthe top-level capture if the source text matched the RE, Nothing otherwise)\the main top-level capture (capture '0'') and the sub captures if the text matched the RE, Nothing otherwise*an alternative for captureText+look up the text of the nth capture, 0 being the match of the whole RE against the source text, 1, the first bracketed sub-expression to be matched and so on,#an alternative for captureTextMaybe-look up the text of the nth capture (0 being the match of the whole), returning Nothing if the Match doesn't contain the capture.an alternative for capture/look up the nth capture, 0 being the match of the whole RE against the source text, 1, the first bracketed sub-expression to be matched and so on0'an alternative for capture captureMaybe1look up the nth capture, 0 being the match of the whole RE against the source text, 1, the first bracketed sub-expression to be matched and so on, returning Nothing if there is no such capture, or if the capture failed to capture anything (being in a failed alternate)2=convert a regex-base native MatchText into a regex Match typethis instance hooks C into regex-base: regex consumers need not worry about any of this !"#$%&'()*+,-./012 !"#$%&'()*+,-./012 !"#$%&'()*+,-./012*9 .9 None!"09;<=31the result of matching a RE against a text (with *=~/), retaining the text that was matched against5the source text being matched6all  instances found, left to right73tests whether the RE matched the source text at all8count the matches9list the texts that Matched:(extract the main capture from each matchthis instance hooks 3C into regex-base: regex consumers need not worry about any of this 3456789:3456789:3456789:None0;?used to throw an exception reporting an abuse of a quasi quoter=)in what context was the quasi quoter used>%how was the quasi quoter being abused?ha quasi quoter that can be used in no context (to be extended with the appropriate quasi quoter parser);<=>?;<=>?;<=>?Safe@GConvert a string into a regular expression that will match that string=returns True iff the charactr is an RE meta character ('[',  , '{', etc.)@@@None0ATAza convenience function used by the API modules to insert capture names extracted from the parsed RE into the (*=~) resultBza convenience function used by the API modules to insert capture names extracted from the parsed RE into the (?=~) resultCYa hairy dynamically-typed function used with the legacy (=~) and (=~~) to see if it can/should add the capture names extracted from the RE into the polymorphic result of the operator (it does for any Match or Matches type, provided it is parameterised over a recognised type). The test suite is all over this one, testing all of these cases.ABCABCABCNone<=?IDMacroID is just a wrapped String type with an IsString instanceG5our macro tables are parameterised over the back end RE# type and and just associate each MacroID with an RE3 (which may in turn contain macros to be expanded)Hlthe general options for an RE are dependent on which back end is being used and are parameterised over the RE! type for the back end, and its  CompOption and  ExecOptionc types (the compile-time and execution time options, respectively); each back end will define an  REOptions_ type that fills out these three type parameters with the apropriate types (see, for example,  Text.RE.TDFA)J!the available TestBench RE macrosK!the back end compile-time optionsL#the back end execution-time optionsMpthe default API uses these simple, universal RE options, which get auto-converted into the apropriate back-end HN@case-sensitive with ^ and $ matching the start and end of a lineO?case-insensitive with ^ and $ matsh the start and end of a linePHcase-sensitive with ^ and $ matching the start and end of the input textQJcase-insensitive with ^ and $ matching the start and end of the input textR#a macro table containing no entriesSMacroID is used with  HM.HashMap to build macro lookup tablesT4we need to use this in the quasi quoters to specify SimpleREOptions selected by the quasi quoterDEFGHIJKLMNOPQRSTDEFGHIJKLMNOPQRMNOPQHIJKLGDEFRDEFGHIJKLMNOPQRSTNone!"9:;"_ua selction of the Replace methods can be encapsulated with ReplaceMethods for the higher-order replacement functionscFReplace provides the missing needed to replace the matched text in a Replace a => Match a.dlength function for aeinject String into afproject a onto a Stringginject into Texthproject Text onto aisplit into linesjconcatenate a list of lineskappend a newlinel*apply a substitution function to a CapturemKconvert a template containing $0, $1, etc., in the first argument, into a phiJ replacement function for use with replaceAllCaptures and replaceCapturesnthe  RELocationg information passed into the substitution function specifies which sub-expression is being substitutedpxthe zero-based, i-th string to be matched, when matching all strings, zero when only the first string is being matchedq0, when matching the top-level string matched by the whole RE, 1 for the top-most, left-most redex captured by bracketed sub-REs, etc.r REContext= specifies which contexts the substitutions should be appliedsZsubstitutions should be applied to the top-level only, the text that matched the whole REtOsubstitutions should only be applied to the text captured by bracketed sub-REsukthe substitution function should be applied to all captures, the top level and the sub-expression capturesvRTrue iff the location references a complete match (i.e., not a bracketed capture)wKreplace all with a template, $0 for whole text, $1 for first capture, etc.xsubstitutes using a function that takes the full Match context and returns the same replacement text as the _phi_phi context.yvreplaceAllCaptures_ is like like replaceAllCaptures but takes the Replace methods through the ReplaceMethods argumentzUreplaceAllCapturesM is just a monadically generalised version of replaceAllCaptures_|substitutes using a function that takes the full Match context and returns the same replacement text as the _phi_phi context.}kreplaceCaptures_ is like replaceCaptures but takes the Replace methods through the ReplaceMethods argument~OreplaceCapturesM is just a monadically generalised version of replaceCaptures_expand all of the @{..} macros in the RE in the argument String according to the Macros argument, preprocessing the RE String according to the Mode argument (used internally)Gexpand the @{..} macos in the argument string using the given functionTlist all of the CaptureID references in the replace template in the second argument4parse a Match generated by acan_template, returning 3Left "$") iff the capture reference is an escaped $ (i.e., $$@)lscan a replacement template, returning a Match for each capture reference in the template (like $1, ${foo})EreplaceMethods encapsulates ReplaceMethods a from a Replace a contextGparse the replacement template in second argument, substititing the capture references with corresponding captures from the Match in the third argument (the result of a single match of the RE against the input text to be matched); Nothing is returned if the inputs are not well formed (currently all inputs are well formed)0_`abcdefghijklmnopqrstuvwxyz{|}~$_`bacmdefghijklnopqrstuvwxyz{|}~_`abc defghijklmnopqrstuvwxyz{|}~NoneR  !"#$%&'()*+,-./0123456789:_`bacmdefghijklnopqrstuvwxyz{|}~Rwxyz{|}~rstunopqv3456789: !"#$%&'()*+,-./012  cdefghijklm_`abNone!"Iwe are only interested in the open parentheses used for grouping and/or capturing; if neither grouping or capturing then there is no initial '(' or '(?:', just the suffic text following text optional ( or (?: a '(' that is not safe to modifyis this a grouping groupis this a capturing groupLname of the Haskell parser function for parsing the text matched by a macroa RE that should work for POSIX and PCRE with open brackets ('(') represented as follows: ( mere symbol (?: used for grouping only, not for captures (}: used for captures only, not for grouping (]: used for captures and grouping ( do not modify$list of failures on a validation runIdescribes a macro, giving the text of the RE and a si=ummary descriptionthe REsome sample matchessome sample non-matchesvalidation test resultsWA, the parser functionsummary commentoeach macro can reference others, the whole environment being required for each macro, so we use a Lazy HashMapPdo we need the captures in the RE or whould they be stripped out where possibleinclude all capturesremove captures where possible)what flavour of regex are we dealing with test RegexType for TDFA/PCREness test RegexType for TDFA/PCREness>construct a macro table suitable for use with the RE compilers9test that a MacroEnv is passing all of its built-in tests)format a macros table as a markdown table(generate a plain text summary of a macro0list the source REs for each macro in plain text/list the source of a single macro in plain textN)DEF0None$  6  NoneNone8None!"I +an enumeration of all of the prelude macros6generate the standard prelude Macros used to parse REs6format the standard prelude macros in a markdown table0generate a textual summary of the prelude macrosZgenerate a plain text table giving the RE for each macro with all macros expanded (to NF)<generate plain text giving theexpanded RE for a single macro generate the  for the standard prelude macros  generate the  for a given naming the macros )all prelude macros are prefixed with this a digit string macrosee  'https://mathiasbynens.be/demo/url-regex (based on @stephenhay URL)9    !"#$%&- $    !"#$%& None!"<= the m class allows polymorhic tools to be written that will work with a variety of regex back ends and text typesfinding the first matchfinding all matches5compiling an RE, failing if the RE is not well formedcomiling an RE, specifying the M compiling a U template from the RE text and the template Text, failing if they are not well formed compiling a  template specifing the M for the REIincorporate an escaped string into a compiled RE with the default optionsDincorporate an escaped string into a compiled RE with the specified M&extract the text of the RE from the REsearch and replace all matches in the argument text; e.g., this function will convert every YYYY-MM-DD format date in its argument text into a DD/MM/YYYY date: XsearchReplaceAll [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|]search and replace the first occurrence only (if any) in the input text e.g., to prefix the first string of four hex digits in the imput text, if any, with 0x: .searchReplaceFirst [ed|[0-9A-Fa-f]{4}///0x$0|]  NoneNone!"2oa LineEdit is the most general action thar can be performed on a line and is the only means of deleting a line%do not edit this line but leave as isLreplace the line with this text (terminating newline should not be included)delete the this line altogether<each Edit action specifies how the match should be processedPreplace the match with this template text, substituting ${capture} as apropriate!use this function to replace the r( specified captures in each line matched+use this function to edit each line matchedan  script will, for each line in the file, either perform the action selected by the first RE in the list, or perform all of the actions on line, arranged as a pipelinefor each line select the first Edit- to match each line and edit the line with it?for each line apply every edit that matches in turn to the line apply an  script to a single lineapply a single edit action to a line, the function in the first argument being used to add a new line onto the end of the line where appropriate; the function returns Nothing- if no edit is to be performed on the line,  Just mempty to delete the lineapply a  to a line, using the function in the first argument to append a new line to the result; Nothing should be returned if no edit is to be performed,  Just mempty to delete the line'(v  !"#$%&'()*+,-./0123456789:_`bacmdefghijklnopqrstuvwxyz{|}~$ '(None!":read a file, apply an } script to each line it and write the file out again; "-" is used to indicate standard input standard output as appropriate apply an ) script to each line of the argument text)*x  !"#$%&'()*+,-./0123456789:_`bacmdefghijklnopqrstuvwxyz{|}~& )* None!"as we don't want the  directoryZ and FilePath dependencies we will abstract the three calls we need into this record type)doesDirectoryExist from System.DirectoryDeither getDirectoryContents or listDirectory from System.Directory / from System.FilePathrecursively list all files whose filename matches given RE, sorting the list into ascending order; if the argument path has a trailing + then it will be removedzrecursively list all files whose filename matches given RE, using the given function to determine which matches to accept"the directory and filepath methodsresult post-processing functionfiltering function*re to be matched against the leaf filenameroot directory of the search,i  !"#$%&'()*+,-./0123456789:_`bacmdefghijklnopqrstuvwxyz{|}~, None!": a GrepScript lists RE-action associations, with the first RE to match a line selecting the action to be executed on each line in the file returns a 0 for each line in the file, listing all of the 3 for that linethe  for this lineall the 3 of the RE on this line7specifies whether to return the linss matched or missedoperates a bit like classic grep printing out the lines matched returns a I for each line in the file, enumerating all of the matches for that line returns a R for each line in the argument text, enumerating all of the matches for that line!given a list of lines, apply the  to each line of the file &generate a grep report from a list of  given a velocity9 flag filter out either the lines matched or not matched  v  !"#$%&'()*+,-./0123456789:_`bacmdefghijklnopqrstuvwxyz{|}~  $     !NoneCa simple regex-based scanner interpretter for prototyping scannersa higher order version of  parameterised over the  matchOnce function Noned  !"#$%&'()*+,-./0123456789:_`bacmdefghijklnopqrstuvwxyz{|}~"None  !"#$%&'()*+,-./0123456789:_`bacmdefghijklnopqrstuvwxyz{|}~  =   #None  !"#$%&'()*+,-./0123456789:DEFGHIJKLMNOPQR_`bacmdefghijklnopqrstuvwxyz{|}~  $None!"5--options for the general Token formatter below.!Posix, PCRE or indeterminate REs?/remove captures where possible0"include the captures in the output-our RE scanner returns a list of these tokensquasi quoter for CaptureID: [cp|0|], [cp|0|]>, etc., indexing captures by classic positional numbers, and  [cp|foo|]%, etc., referencing a named capture [re| ... ${foo}( ... ) ... |].extract the CaptureNames from an RE or return an error diagnostic if the RE is not well formed; also returs the total number of captures in the RE!check that a token is well formed1Banalyse a token stream, returning the number of captures and the (scan a RE string into a list of RE Token format [Token] into an RE string21the default configuration for the Token formatterOa configuration that will preserve the parsed regular expression in the outputDthe general Token formatter, generating REs according to the options-3./04567891:2945678 -3./04567891:2%None!" warapper on A that will generate an error if any compilation errors are foundcompile a SearchReplace template generating errors if the RE or the template are not well formed -- all capture references being checkedcompile  SearcgReplaceA from two strings containing the RE and the replacement template;;None6;<=>?@ABC6CAB@;<=>?&None !"9:;<=&)and the REOptions for this back end (see Text.RE.REOptions for details)(a number of types can be used to encode H/, each of which is made a member of this class convert the o type into an  REOptions Fthe RE type for this back end representing a well-formed, compiled RE!some functions in the Text.RE.TestBench2 need the back end to be passed dynamically as a  parameters: use ! for this" extract the  from the RE#&extract the RE source string from the RE$ extract the  from the RE%extract the back end compiled < type from the RE& the default ' the default  but with no RE macros defined(convert a universal SimpleReOptions into the  used by this back end) compile a = into a  L with the default options, generating an error if the RE is not well formed* compile a = into a   using the given SimpleREOptions3, generating an error if the RE is not well formed+ compile a = into a   using the given SimpleREOptions3, generating an error if the RE is not well formed,compile a SearchReplace template generating errors if the RE or the template are not well formed, all capture references being checked-compile a SearchReplace template, with simple options, generating errors if the RE or the template are not well formed, all capture references being checked.compile a SearchReplace template, with general options, generating errors if the RE or the template are not well formed, all capture references being checked/convert a string into a RE that matches that string, and apply it to an argument continuation function to make up the RE string to be compiled; e.g., to compile a RE that will only match the string: /maybe undefined id . escape (("^"++) . (++"$"))0 a variant of / where the M are specified1 a variant of 0 that allows an  RE option to be specified2the standard table of G= used to compile REs (which can be extended or replace: see Text.RE.TestBench)3 the standard  for this back end (see Text.RE.TestBench)4lthe macros in the standard environment that are failing their tests (checked by the test suite to be empty)5.a table the standard macros in markdown format6Ta summary of the macros in the standard environment for this back end in plain text7la listing of the RE text for each macro in the standard environment with all macros expanded to normal form8?the prolude source of a given macro in the standard environment9 [re| ... |], is equivalent to [reMultilineSensitive| ... |],, compiling a case-sensitive, multi-line RE:[reMultilineSensitive| ... |]*, compiles a case-sensitive, multi-line RE;[reMultilineInsensitive| ... |],, compiles a case-insensitive, multi-line RE<[reMultilineInsensitive| ... |]., compiles a case-sensitive, non-multi-line RE=[reMultilineInsensitive| ... |]0, compiles a case-insensitive, non-multi-line RE> [reMS| ... |] is a shorthand for [reMultilineSensitive| ... |]? [reMI| ... |] is a shorthand for [reMultilineInsensitive| ... |]@ [reBS| ... |] is a shorthand for [reBlockSensitive| ... |]A [reBI| ... |] is a shorthand for eBlockInsensitive| ... |]B [re_| ... |]I compiles a RE to produce a function that takes the RE options (e.g., a MD value) and yields the RE compiled with those options. For example, :countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive2counts the number of hexadecimal digit strings in sn, allowing for upper- or lower-case hex didgits (which is entirely equivalent in this example to just using #[reMultilineInsensitive|[0-9a-f]+|]).9 >?@AB!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP(@ !"#$%&'()*+,-./0123456789:;<=>?@AB3 >?@AB!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP'None:Q5construct a quasi quoter from a casting function and Just sroA if the options are known, otherwise a function take takes the M and constructs the  templateQRSQQRS(None Cthe [ed| ... /// ... |] quasi quotersDthe [ed| ... /// ... |] quasi quotersEthe [ed| ... /// ... |] quasi quotersFthe [ed| ... /// ... |] quasi quotersGthe [ed| ... /// ... |] quasi quotersHthe [ed| ... /// ... |] quasi quotersIthe [ed| ... /// ... |] quasi quotersJthe [ed| ... /// ... |] quasi quotersKthe [ed| ... /// ... |] quasi quotersLthe [ed| ... /// ... |] quasi quoters CDEFGHIJKLT CDEFGHIJKL CDEFGHIJKLT)None M[ed| ... /// ... |], is equivalent to %[edMultilineSensitive| ... /// ... |]*, compiling a case-sensitive, multi-line N%[edMultilineSensitive| ... /// ... |]' compiles a case-sensitive, multi-line  templateO'[edMultilineInsensitive| ... /// ... |]) compiles a case-insensitive, multi-line  templateP![edBlockSensitive| ... /// ... |]+ compiles a case-sensitive, non-multi-line  templateQ#[edBlockInsensitive| ... /// ... |]- compiles a case-insensitive, non-multi-line  templateR[edMS| ... /// ... |] is a shorthand for %[edMultilineSensitive| ... /// ... |]S[edMI| ... /// ... |] is a shorthand for '[edMultilineInsensitive| ... /// ... |]T[edBS| ... /// ... |] is a shorthand for ![edBlockSensitive| ... /// ... |]U[edBI| ... /// ... |] is a shorthand for #[edBlockInsensitive| ... /// ... |]V[ed_| ... /// ... |] compiles a D template to produce a function that takes the RE options (e.g., a M value) and yields the 3 template compiled with those options. For example, ?s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive1prefixes the hexadecimal digit strings in s with 0xn, allowing for upper- or lower-case hex didgits (which is entirely equivalent in this example to just using #[edMultilineInsensitive|[0-9a-f]+|]). MNOPQRSTUVUV MNOPQRSTUV MNOPQRSTUVUV None9:;<=WWfind all the matches in the argument text; e.g., to count the number of naturals in s: !countMatches $ s *=~ [re|[0-9]+|]Xifind the first match in the argument text; e.g., to test if there is a natural number in the input text: matched $ s ?=~ [re|[0-9]+|]Ysearch and replace all matches in the argument text; e.g., this section will convert every YYYY-MM-DD format date in its argument text into a DD/MM/YYYY date: N(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])Zsearch and replace the first occurrence only (if any) in the input text e.g., to prefix the first string of four hex digits in the input text, if any, with 0x: "(?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])[the  `regex-base` polymorphic match operator\the  `regex-base`$ monadic, polymorphic match operatorWXYZ[\]^!&'365789@MNOPQ #)*,-/09:;<=>?@ABMNOPQRSTUVWXYZ[\:WXYZ35656789!!&' #MNOPQ)*,-/0@[\9:;<=>?@ABNOPQMRSTUVWXYZ[\]*None ^[ed| ... /// ... |], is equivalent to %[edMultilineSensitive| ... /// ... |]*, compiling a case-sensitive, multi-line _%[edMultilineSensitive| ... /// ... |]' compiles a case-sensitive, multi-line  template`'[edMultilineInsensitive| ... /// ... |]) compiles a case-insensitive, multi-line  templatea![edBlockSensitive| ... /// ... |]+ compiles a case-sensitive, non-multi-line  templateb#[edBlockInsensitive| ... /// ... |]- compiles a case-insensitive, non-multi-line  templatec[edMS| ... /// ... |] is a shorthand for %[edMultilineSensitive| ... /// ... |]d[edMI| ... /// ... |] is a shorthand for '[edMultilineInsensitive| ... /// ... |]e[edBS| ... /// ... |] is a shorthand for ![edBlockSensitive| ... /// ... |]f[edBI| ... /// ... |] is a shorthand for #[edBlockInsensitive| ... /// ... |]g[ed_| ... /// ... |] compiles a D template to produce a function that takes the RE options (e.g., a M value) and yields the 3 template compiled with those options. For example, ?s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive1prefixes the hexadecimal digit strings in s with 0xn, allowing for upper- or lower-case hex didgits (which is entirely equivalent in this example to just using #[edMultilineInsensitive|[0-9a-f]+|]). ^_`abcdefgWX ^_`abcdefg ^_`abcdefgWXNone9:;<=hWfind all the matches in the argument text; e.g., to count the number of naturals in s: !countMatches $ s *=~ [re|[0-9]+|]iifind the first match in the argument text; e.g., to test if there is a natural number in the input text: matched $ s ?=~ [re|[0-9]+|]jsearch and replace all matches in the argument text; e.g., this section will convert every YYYY-MM-DD format date in its argument text into a DD/MM/YYYY date: N(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])ksearch and replace the first occurrence only (if any) in the input text e.g., to prefix the first string of four hex digits in the input text, if any, with 0x: "(?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])lthe  `regex-base` polymorphic match operatormthe  `regex-base`$ monadic, polymorphic match operatorhijklmn^!&'365789@MNOPQ #)*,-/09:;<=>?@AB^_`abcdefghijklm:hijk35656789!!&' #MNOPQ)*,-/0@lm9:;<=>?@AB_`ab^cdefghijklmn+None o[ed| ... /// ... |], is equivalent to %[edMultilineSensitive| ... /// ... |]*, compiling a case-sensitive, multi-line p%[edMultilineSensitive| ... /// ... |]' compiles a case-sensitive, multi-line  templateq'[edMultilineInsensitive| ... /// ... |]) compiles a case-insensitive, multi-line  templater![edBlockSensitive| ... /// ... |]+ compiles a case-sensitive, non-multi-line  templates#[edBlockInsensitive| ... /// ... |]- compiles a case-insensitive, non-multi-line  templatet[edMS| ... /// ... |] is a shorthand for %[edMultilineSensitive| ... /// ... |]u[edMI| ... /// ... |] is a shorthand for '[edMultilineInsensitive| ... /// ... |]v[edBS| ... /// ... |] is a shorthand for ![edBlockSensitive| ... /// ... |]w[edBI| ... /// ... |] is a shorthand for #[edBlockInsensitive| ... /// ... |]x[ed_| ... /// ... |] compiles a D template to produce a function that takes the RE options (e.g., a M value) and yields the 3 template compiled with those options. For example, ?s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive1prefixes the hexadecimal digit strings in s with 0xn, allowing for upper- or lower-case hex didgits (which is entirely equivalent in this example to just using #[edMultilineInsensitive|[0-9a-f]+|]). opqrstuvwxYZ opqrstuvwx opqrstuvwxYZNone9:;<=yWfind all the matches in the argument text; e.g., to count the number of naturals in s: !countMatches $ s *=~ [re|[0-9]+|]zifind the first match in the argument text; e.g., to test if there is a natural number in the input text: matched $ s ?=~ [re|[0-9]+|]{search and replace all matches in the argument text; e.g., this section will convert every YYYY-MM-DD format date in its argument text into a DD/MM/YYYY date: N(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])|search and replace the first occurrence only (if any) in the input text e.g., to prefix the first string of four hex digits in the input text, if any, with 0x: "(?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])}the  `regex-base` polymorphic match operator~the  `regex-base`$ monadic, polymorphic match operatoryz{|}~^!&'365789@MNOPQ #)*,-/09:;<=>?@ABopqrstuvwxyz{|}~:yz{|35656789!!&' #MNOPQ)*,-/0@}~9:;<=>?@ABpqrsotuvwxyz{|}~,None [ed| ... /// ... |], is equivalent to %[edMultilineSensitive| ... /// ... |]*, compiling a case-sensitive, multi-line %[edMultilineSensitive| ... /// ... |]' compiles a case-sensitive, multi-line  template'[edMultilineInsensitive| ... /// ... |]) compiles a case-insensitive, multi-line  template![edBlockSensitive| ... /// ... |]+ compiles a case-sensitive, non-multi-line  template#[edBlockInsensitive| ... /// ... |]- compiles a case-insensitive, non-multi-line  template[edMS| ... /// ... |] is a shorthand for %[edMultilineSensitive| ... /// ... |][edMI| ... /// ... |] is a shorthand for '[edMultilineInsensitive| ... /// ... |][edBS| ... /// ... |] is a shorthand for ![edBlockSensitive| ... /// ... |][edBI| ... /// ... |] is a shorthand for #[edBlockInsensitive| ... /// ... |][ed_| ... /// ... |] compiles a D template to produce a function that takes the RE options (e.g., a M value) and yields the 3 template compiled with those options. For example, ?s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive1prefixes the hexadecimal digit strings in s with 0xn, allowing for upper- or lower-case hex didgits (which is entirely equivalent in this example to just using #[edMultilineInsensitive|[0-9a-f]+|]). [\  [\None9:;<=Wfind all the matches in the argument text; e.g., to count the number of naturals in s: !countMatches $ s *=~ [re|[0-9]+|]ifind the first match in the argument text; e.g., to test if there is a natural number in the input text: matched $ s ?=~ [re|[0-9]+|]search and replace all matches in the argument text; e.g., this section will convert every YYYY-MM-DD format date in its argument text into a DD/MM/YYYY date: N(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])search and replace the first occurrence only (if any) in the input text e.g., to prefix the first string of four hex digits in the input text, if any, with 0x: "(?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])the  `regex-base` polymorphic match operatorthe  `regex-base`$ monadic, polymorphic match operator^!&'365789@MNOPQ #)*,-/09:;<=>?@AB:35656789!!&' #MNOPQ)*,-/0@9:;<=>?@AB-None [ed| ... /// ... |], is equivalent to %[edMultilineSensitive| ... /// ... |]*, compiling a case-sensitive, multi-line %[edMultilineSensitive| ... /// ... |]' compiles a case-sensitive, multi-line  template'[edMultilineInsensitive| ... /// ... |]) compiles a case-insensitive, multi-line  template![edBlockSensitive| ... /// ... |]+ compiles a case-sensitive, non-multi-line  template#[edBlockInsensitive| ... /// ... |]- compiles a case-insensitive, non-multi-line  template[edMS| ... /// ... |] is a shorthand for %[edMultilineSensitive| ... /// ... |][edMI| ... /// ... |] is a shorthand for '[edMultilineInsensitive| ... /// ... |][edBS| ... /// ... |] is a shorthand for ![edBlockSensitive| ... /// ... |][edBI| ... /// ... |] is a shorthand for #[edBlockInsensitive| ... /// ... |][ed_| ... /// ... |] compiles a D template to produce a function that takes the RE options (e.g., a M value) and yields the 3 template compiled with those options. For example, ?s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive1prefixes the hexadecimal digit strings in s with 0xn, allowing for upper- or lower-case hex didgits (which is entirely equivalent in this example to just using #[edMultilineInsensitive|[0-9a-f]+|]). ]^  ]^None9:;<=Wfind all the matches in the argument text; e.g., to count the number of naturals in s: !countMatches $ s *=~ [re|[0-9]+|]ifind the first match in the argument text; e.g., to test if there is a natural number in the input text: matched $ s ?=~ [re|[0-9]+|]search and replace all matches in the argument text; e.g., this section will convert every YYYY-MM-DD format date in its argument text into a DD/MM/YYYY date: N(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])search and replace the first occurrence only (if any) in the input text e.g., to prefix the first string of four hex digits in the input text, if any, with 0x: "(?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])the  `regex-base` polymorphic match operatorthe  `regex-base`$ monadic, polymorphic match operator^!&'365789@MNOPQ #)*,-/09:;<=>?@AB:35656789!!&' #MNOPQ)*,-/0@9:;<=>?@AB.None [ed| ... /// ... |], is equivalent to %[edMultilineSensitive| ... /// ... |]*, compiling a case-sensitive, multi-line %[edMultilineSensitive| ... /// ... |]' compiles a case-sensitive, multi-line  template'[edMultilineInsensitive| ... /// ... |]) compiles a case-insensitive, multi-line  template![edBlockSensitive| ... /// ... |]+ compiles a case-sensitive, non-multi-line  template#[edBlockInsensitive| ... /// ... |]- compiles a case-insensitive, non-multi-line  template[edMS| ... /// ... |] is a shorthand for %[edMultilineSensitive| ... /// ... |][edMI| ... /// ... |] is a shorthand for '[edMultilineInsensitive| ... /// ... |][edBS| ... /// ... |] is a shorthand for ![edBlockSensitive| ... /// ... |][edBI| ... /// ... |] is a shorthand for #[edBlockInsensitive| ... /// ... |][ed_| ... /// ... |] compiles a D template to produce a function that takes the RE options (e.g., a M value) and yields the 3 template compiled with those options. For example, ?s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive1prefixes the hexadecimal digit strings in s with 0xn, allowing for upper- or lower-case hex didgits (which is entirely equivalent in this example to just using #[edMultilineInsensitive|[0-9a-f]+|]). _`  _`None9:;<=Wfind all the matches in the argument text; e.g., to count the number of naturals in s: !countMatches $ s *=~ [re|[0-9]+|]ifind the first match in the argument text; e.g., to test if there is a natural number in the input text: matched $ s ?=~ [re|[0-9]+|]search and replace all matches in the argument text; e.g., this section will convert every YYYY-MM-DD format date in its argument text into a DD/MM/YYYY date: N(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])search and replace the first occurrence only (if any) in the input text e.g., to prefix the first string of four hex digits in the input text, if any, with 0x: "(?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])the  `regex-base` polymorphic match operatorthe  `regex-base`$ monadic, polymorphic match operator^!&'365789@MNOPQ #)*,-/09:;<=>?@AB:35656789!!&' #MNOPQ)*,-/0@9:;<=>?@AB None:Wfind all the matches in the argument text; e.g., to count the number of naturals in s: !countMatches $ s *=~ [re|[0-9]+|]ifind the first match in the argument text; e.g., to test if there is a natural number in the input text: matched $ s ?=~ [re|[0-9]+|]search and replace all matches in the argument text; e.g., this section will convert every YYYY-MM-DD format date in its argument text into a DD/MM/YYYY date: N(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|]),search and replace the first occurrence only)the regex-base polymorphic match operator2the regex-base monadic, polymorphic match operatorr!&'365789@MNOPQ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLN35656789!!&' !"#$%MNOPQ&'()*+,-./01@9:;<=>?@ABCHIJKDEFGL2345678/(C) 2016-17 Chris DornanBSD3 (see the LICENSE file)+Chris Dornan <chris.dornan@irisconnect.com>RFCportableSafea001234567899:;;<=>?@ABCCDEFGHIJKKLMNOPQRSTUVWXYZ[\]^^_`abcdeefghijklmmnopqrstuvwxyz{|}~                         ! " # $ % & ' ( ) * + , - . /!0!1$2$3$4$5$6$7$8$9$:%;%<%=&q&>&?&@&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&[&\&]&^&_&`&a&b(c(d(e(f(g(h(i(j(k(l)c)h)i)j)k)d)e)f)g)l m n o p q r s*c*h*i*j*k*d*e*f*g*lmnopqrs+c+h+i+j+k+d+e+f+g+lmnopqrt,c,h,i,j,k,d,e,f,g,lmnopqru-c-h-i-j-k-d-e-f-g-lmnopqrv.c.h.i.j.k.d.e.f.g.lmnopqrv m n o p q rwxyz{|}~ww $$$$$$$$$$$$$$%wx&@&&&&&&&&&&&&&& & & & & '''())**++,,--..$regex-1.0.0.0-IoVmeGG5IT48v70F9h4hdzText.RE.Tools.IsRegexText.RE.Tools.EditText.RE.ReplaceText.RE.ZeInternalsText.RE.REOptionsText.RE.TestBenchText.RE.TestBench.ParsersText.RE.Tools.SedText.RE.Tools.FindText.RE.Tools.GrepText.RE.Tools.Lex Text.RE.TDFAText.RE.TDFA.ByteStringText.RE.TDFA.ByteString.LazyText.RE.TDFA.SequenceText.RE.TDFA.StringText.RE.TDFA.TextText.RE.TDFA.Text.Lazy'Text.RE.ZeInternals.Types.SearchReplace Text.RE.ZeInternals.Types.LineNo#Text.RE.ZeInternals.Types.CaptureID!Text.RE.ZeInternals.Types.CaptureText.RE.ZeInternals.Types.Match!Text.RE.ZeInternals.Types.MatchesText.RE.ZeInternals.QQ"Text.RE.ZeInternals.EscapeREString#Text.RE.ZeInternals.AddCaptureNamesText.RE.ZeInternals.ReplaceText.RE.ZeInternals.TestBench%Text.RE.ZeInternals.TestBench.Parsers!Text.RE.ZeInternals.PreludeMacros!Text.RE.ZeInternals.Types.IsRegexText.RE.ZeInternals.Tools.Lex Text.RE.Tools Text.RE.Summa!Text.RE.ZeInternals.NamedCaptures!Text.RE.ZeInternals.SearchReplaceText.RE.ZeInternals.TDFA-Text.RE.ZeInternals.SearchReplace.TDFAEdPrime&Text.RE.ZeInternals.SearchReplace.TDFA1Text.RE.ZeInternals.SearchReplace.TDFA.ByteString6Text.RE.ZeInternals.SearchReplace.TDFA.ByteString.Lazy/Text.RE.ZeInternals.SearchReplace.TDFA.Sequence-Text.RE.ZeInternals.SearchReplace.TDFA.String+Text.RE.ZeInternals.SearchReplace.TDFA.Text0Text.RE.ZeInternals.SearchReplace.TDFA.Text.LazyText.RE SearchReplace getSearch getTemplateLineNoZeroBasedLineNogetZeroBasedLineNo firstLine getLineNolineNoCaptureOrdinalgetCaptureOrdinal CaptureNamegetCaptureName CaptureNames CaptureIDIsCaptureOrdinal IsCaptureNamenoCaptureNames findCaptureIDCapture captureSource capturedText captureOffset captureLength hasCaptured capturePrefix captureSuffixMatch matchSource captureNames matchArraynoMatchemptyMatchArraymatched matchedText matchCapture matchCaptures!$$ captureText!$$?captureTextMaybe!$capture!$? captureMaybeconvertMatchTextMatches matchesSource allMatches anyMatches countMatchesmatches mainCaptures QQFailure _qqf_context_qqf_componentqq0escapeREStringaddCaptureNamesToMatchesaddCaptureNamesToMatchaddCaptureNamesMacroID getMacroIDMacros REOptions_ REOptions optionsMacs optionsComp optionsExecSimpleREOptionsMultilineSensitiveMultilineInsensitiveBlockSensitiveBlockInsensitive emptyMacros$fHashableMacroID$fLiftSimpleREOptions$fBoundedSimpleREOptions$fEnumSimpleREOptions$fEqSimpleREOptions$fOrdSimpleREOptions$fShowSimpleREOptions$fIsStringMacroID $fOrdMacroID $fEqMacroID $fShowMacroID$fShowREOptions_ReplaceMethods methodLength methodSubstReplacelengthRpackRunpackRtextifyR detextifyRlinesRunlinesRappendNewlineRsubstRparseTemplateR RELocation locationMatchlocationCapture REContextTOPSUBALL isTopLocation replaceAllreplaceAllCapturesreplaceAllCaptures_replaceAllCapturesMreplacereplaceCapturesreplaceCaptures_replaceCapturesM expandMacrosreplaceMethods RegexSource _RegexSourceMacroDescriptor macroSource macroSamplesmacroCounterSamplesmacroTestResults macroParsermacroDescriptionMacroEnv WithCaptures InclCaptures ExclCaptures RegexTypeisTDFAisPCREmkTDFAmkPCREpresentRegexTypemkMacros testMacroEnv badMacrosrunTests runTests'formatMacroTableformatMacroSummaryformatMacroSourcesformatMacroSource mdRegexSourceSeverityEmergAlertCritErrWarningNoticeInfoDebug IPV4Address parseIntegerparseHex parseDouble parseStringparseSimpleString parseDateparseSlashesDateparseTimeOfDay parseTimeZone parseDateTimeparseDateTime8601parseDateTimeCLFparseShortMonthshortMonthArrayparseIPv4Address parseSeverityseverityKeywords PreludeMacroPM_natPM_hexPM_intPM_frac PM_stringPM_string_simplePM_idPM_id'PM_id_PM_datePM_date_slashesPM_time PM_timezone PM_datetimePM_datetime_8601PM_datetime_clf PM_shortmonthPM_address_ipv4PM_email_simplePM_urlPM_syslog_severity preludeMacrospreludeMacroTablepreludeMacroSummarypreludeMacroSourcespreludeMacroSourcepreludeMacroEnvpresentPreludeMacroIsRegex matchOnce matchMany makeRegex makeRegexWithmakeSearchReplacemakeSearchReplaceWith makeEscapedmakeEscapedWith regexSourcesearchReplaceAllsearchReplaceFirstLineEditNoEdit ReplaceWithDeleteEditTemplateFunctionEditsSelectPipe applyEdits applyEdit applyLineEdit$fFunctorLineEdit$fShowLineEditsedsed' FindMethodsdoesDirectoryExistDMlistDirectoryDM combineDM findMatches_ findMatches_' GrepScriptLine getLineNumbergetLineMatches Verbosity LinesMatchedLinesNotMatchedgrep grepLines grepFiltergrepWithScriptreport linesMatched$fShowVerbosity $fEqVerbosity$fOrdVerbosity $fShowLinealexalex'TokencpextractNamedCaptures validTokenscan formatTokensidFormatTokenREOptions formatTokens' formatTokens0unsafeCompileSearchReplace_compileSearchReplace_compileSearchAndReplace_IsOption makeREOptionsRE regexType reOptionsreSourcereCaptureNamesreRegexdefaultREOptionsnoPreludeREOptionsunpackSimpleREOptions compileRegexcompileRegexWithcompileRegexWithOptionscompileSearchReplacecompileSearchReplaceWithcompileSearchReplaceWithOptionsescape escapeWithescapeWithOptionsprelude preludeEnvpreludeTestsFailing preludeTablepreludeSummarypreludeSources preludeSourcerereMultilineSensitivereMultilineInsensitivereBlockSensitivereBlockInsensitivereMSreMIreBSreBIre_ededMSedMIedBSedBIedMultilineSensitiveedMultilineInsensitiveedBlockSensitiveedBlockInsensitiveed_*=~?=~*=~/?=~/=~=~~$fIsRegexREByteString$fIsRegexRESeq $fIsRegexRE[]$fIsRegexRETextbaseGHC.Base$$fFunctorSearchReplace$fHashableCaptureName$fFunctorCapture$fRegexContextregexsourceMatchlookupCaptureID$fFunctorMatch $fRegexContextregexsourceMatches$fFunctorMatches$fExceptionQQFailure isMetaCharGHC.Num* expandMacros'templateCapturesparse_template_capture scan_templateparseTemplateR'lift_phifixpoint$=~ $fReplaceText$fReplaceText0 $fReplaceSeq$fReplaceByteString$fReplaceByteString0 $fReplace[]REToken _ret_prefix _ret_fixed _ret_grouping_ret_capturing FunctionID TestResultColC_nameC_capsC_regex C_examplesC_anti_examplesC_failsC_parser C_commentTableRow _FunctionID _TestResultTDFAPCRETestBenchMatchertestMacroDescriptors present_colmacro_table_hdrmacro_table_rowmacro_attribute format_table field_widthwrap_rowwidths format_rowfieldselljust min_captures format_tokens delete_ketscan_retest' test_neg'test_diagnostic$fShowRegexTypedate_templatestime_templatestimezone_templatesdate_time_8601_templatesdate_time_templates parse_timeshort_month_hm severity_hmwords_bypreludeMacroDescriptorprelude_prefix decimal_macro url_macroprelude_macro_envprelude_macro_id natural_macronatural_hex_macro integer_macro string_macrostring_simple_macroid_macro id'_macro id__macro date_macrodate_slashes_macro time_macrotimezone_macrodatetime_macrodatetime_8601_macrodatetime_clf_macroshortmonth_macroaddress_ipv4_macrossyslog_severity_macroemail_simple_macro run_testsbracketedRegexSourcefixselect_edit_scriptspipe_edit_scripts read_file write_fileGHC.Real/find_FormatTokenREOptions_fto_regex_type _fto_min_caps_fto_incl_caps analyseTokensdefFormatTokenREOptionsECapPGrpPCapBraBSOther parse_capture'regex-tdfa-1.2.2-JDBpHysOzmCJBjQ8NG5dyEText.Regex.TDFA.CommonRegexString _re_options _re_source _re_cnames _re_regexre'unsafeCompileRegexSimpleunsafeCompileRegexunsafeCompileRegex_ compileRegex' compileRegex_def_comp_optiondef_exec_option $fIsOption()$fIsOptionREOptions_$fIsOptionExecOption$fIsOptionCompOption$fIsOptionHashMap$fIsOptionSimpleREOptionsed'unsafe_compile_sr_simpleunsafe_compile_srcastsr_castfn_cast