ժ,      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       !"#$%&'()*+None,,,None68B       NoneBNoneB  !"#$%&'()  !"#$%&'( $&%#' !")( !"#$&%'()None246*Hthe matching of a single sub-expression against part of the source text, the whole text that was searched-the text that was matched.ythe 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-string0the result of matching a RE to a text once, listing the text that was matched and the named captures in the RE and all of the substrings matched, with the text captured by the whole RE; a complete failure to match will be represented with an empty array (with bounds (0,-1))2the whole source text3the RE's capture names4 @.n-1 captures, starting with the text matched by the whole RE5ithe result type to use when every match is needed, not just the first match of the RE against the source7the source text being matched8!all captures found, left to right93tests whether the RE matched the source text at all:count the matches<(extract the main capture from each match=3tests whether the RE matched the source text at all>3tests whether the RE matched the source text at all?Kthe top-level capture if the source text matched the RE, Nothing otherwise@Ythe top-level capture and the sub captures if the text matched the RE, Nothing otherwiseAlook 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 onBlook up the text of the nth capture (0 being the match of the whole), returning Nothing if the Match doesn't contain the captureClook 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 onDlook 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)E(test if the capture has matched any textF$returns the text preceding the matchG returns the text after the match-,for matching all REs against the source text.6for matching just the first RE against the source text%*+,-./0123456789:;<=>?@ABCD/EFG0-.123*+,-./0123456789:;<=>?@ABCDEFG567801234*+,-./9:;<=>?@ABCDEFG*+,-./0123456789:;<=>?@ABCD/EFG0-.123None234"Hthe Locationg information passed into the substitution function specifies which sub-expression is being substitutedJythe zero-based, i-th string to be matched, when matching all strings, zero when only the first string is being matchedK0, 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.LContext= specifies which contexts the substitutions should be appliedMkthe substitution function should be applied to all captures, the top level and the sub-expression capturesNOsubstitutions should only be applied to the text captured by bracketed sub-REsOZsubstitutions should be applied to the top-level only, the text that matched the whole REPPhif specifies the substitution function for procesing the substrings captured by the regular expression.R*the context for applying the substitutionSthe substitution function takes the location and the text to be replaced and returns the replacement text to be substitutedToa selction of the Replace methods can be encapsulated with Replace_ for the higher-order replacement functionsXoReplace provides the missing methods needed to replace the matched text; length_ is the minimum implementationYlength function for aZinject String into a[project a onto a String\inject into Text]project Text onto a^append a newline_*apply a substitution function to a Capture`Kconvert a template containing $0, $1, etc., in the first argument, into a phiL replacement function for use with replaceAllCaptures' and replaceCaptures'a9replace_ encapsulates Replace_ a from a Replace a contextbRTrue iff the location references a complete match (i.e., not a bracketed capture)cKreplace all with a template, $0 for whole text, $1 for first capture, etc.d5substitutes the PHI substitutions through the Matchesesubstitutes using a function that takes the full Match context and returns the same replacement text as the _phi_phi context.fqreplaceAllCaptures_ is like like replaceAllCaptures' but takes the Replace methods through the Replace_ argumentgUreplaceAllCapturesM is just a monadically generalised version of replaceAllCaptures_hQreplace with a template containing $0 for whole text, $1 for first capture, etc.i3substitutes the PHI substitutions through the Matchjsubstitutes using a function that takes the full Match context and returns the same replacement text as the _phi_phi context.kfreplaceCaptures_ is like replaceCaptures' but takes the Replace methods through the Replace_ argumentlOreplaceCapturesM is just a monadically generalised version of replaceCaptures_mexpand 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)nGexpand the @{..} macos in the argument string using the given function3HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn456789:;<=>?'HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn'XYZ[\]^_`TUVWaPQRSLONMHIJKbhcdefgijklmnHIJKLONMPQRSTUVWXYZ[\]^_`abcdefghijklmn456789:;<=>?None6opqropqropqropqrNonestuvwxyz{|}~@Astuvwxyz{|}~|~}w{zyxsvutsvutw{zyx|~}@ANone3BCBC NoneDEFGHIJKLDEFGHIJKL NoneBMwe 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 textN following text optional ( or (?:O a '(' that is not safe to modifyPis this a grouping groupQis 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 possible.what kind of back end will be compiling the REJRSTUVWXYZ[M\NOPQ]^_`abcdefghijklmnopqr'',RZYXWVUTS[M\NOPQ]^_`abcdefghijklmnopqrNoneBs+an enumeration of all of the prelude macrostnaming the macrosu)all prelude macros are prefixed with thisva digit string macrow see https:/mathiasbynens.be*demo/url-regex (based on @stephenhay URL):sxyz{|}~tuvw-sxyz{|}~&s~}|{zyxtuvw None3 None  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None None0246None23460+NoneNone2346  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None2346  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None2346  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None2346  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None3  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None23460               +     None2346  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     None2346  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     None2346  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     None2346  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     None2346 !"#  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"# !"# !"#None2346$%&'  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     $%&'$%&'$%&'None3()*+  !"#$%&'(*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     ()*+()*+()*+ !"#$%&&'()*+,-./0123456789:;<<=>>?@ABCDEFGGHIJKLLMNOPPQRSTUVWXYZ[\]^_`abbcdefghiijkllmnopqrstuvwxyz{|}~                  ..                        ! " # $  % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 :;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst u u v w x y z z { | } ~                   regex-0.0.0.1Text.RE.OptionsText.RE.LineNoText.RE.CaptureIDText.RE.CaptureText.RE.ReplaceText.RE.IsRegex Text.RE.EditText.RE.Tools.SedText.RE.ParsersText.RE.TestBenchText.RE.Tools.GrepText.RE.Tools.LexText.RE.Internal.NamedCapturesText.RE.PCRE.REText.RE.PCRE.ByteStringText.RE.PCRE.ByteString.LazyText.RE.PCRE.SequenceText.RE.PCRE.String Text.RE.PCREText.RE.TDFA.REText.RE.TDFA.ByteStringText.RE.TDFA.ByteString.LazyText.RE.TDFA.SequenceText.RE.TDFA.StringText.RE.TDFA.TextText.RE.TDFA.Text.Lazy Text.RE.TDFAText.RE.Internal.QQText.RE.Internal.PreludeMacrosText.RE Text.RE.Internal.AddCaptureNamesSimpleRegexOptionsBlockInsensitiveBlockSensitiveMultilineInsensitiveMultilineSensitiveMacrosMacroID_MacroIDModeBlockSimpleIsOption makeOptionsOptions_Options _options_mode _options_macs _options_comp _options_exec emptyMacros$fLiftSimpleRegexOptions$fHashableMacroIDLineNoZeroBasedLineNogetZeroBasedLineNo firstLine getLineNolineNoCaptureOrdinalgetCaptureOrdinal CaptureNamegetCaptureName CaptureNames CaptureIDCID_name CID_ordinalnoCaptureNames findCaptureID$fHashableCaptureNameCapture captureSource capturedText captureOffset captureLengthMatch matchSource captureNames matchArrayMatches matchesSource allMatches anyMatches countMatchesmatches mainCapturesmatched matchedText matchCapture matchCaptures captureTextcaptureTextMaybecapture captureMaybe hasCaptured capturePrefix captureSuffixLocation _loc_match _loc_captureContextALLSUBTOPPhi _phi_context_phi_phiReplace_ _r_length_r_substReplacelength_pack_unpack_textify detextify appendNewlinesubst parse_tplreplace_ isTopLocation replaceAllreplaceAllCapturesreplaceAllCaptures'replaceAllCaptures_replaceAllCapturesMreplacereplaceCapturesreplaceCaptures'replaceCaptures_replaceCapturesM expandMacros expandMacros'IsRegex matchOnce matchMany regexSourceLineEditDelete ReplaceWithNoEditEditEDIT_genEDIT_funEDIT_phiEDIT_tplEditsPipeSelect applyEdits applyEdit applyLineEdit SedScriptsedsed' IPV4Address parseIntegerparseHex parseDouble parseStringparseSimpleString parseDateparseSlashesDateparseTimeOfDay parseTimeZone parseDateTimeparseDateTime8601parseDateTimeCLFparseShortMonthshortMonthArrayparseIPv4AddressparseSyslogSeveritysyslogSeverityKeywords FunctionID _FunctionID RegexSource _RegexSource TestResult _TestResultMacroDescriptor _md_source _md_samples_md_counter_samples_md_test_results _md_parser_md_descriptionMacroEnv WithCaptures ExclCaptures InclCaptures RegexTypePCRETDFAmkMacros testMacroEnv badMacrosrunTests runTests'dumpMacroTableformatMacroTableformatMacroSummaryformatMacroSourcesformatMacroSourcetestMacroDescriptors GrepScriptgrep grepLines grepScriptalexalex'cpextractNamedCapturesnamedCapturesTestTreeRErereMSreMIreBSreBIreMultilineSensitivereMultilineInsensitivereBlockSensitivereBlockInsensitivere_ regexType reOptionsreSourcereCaptureNamesreRegexnoPreludeOptionsdefaultOptionsunpackSimpleRegexOptions compileRegexpreludepreludeTestsFailing preludeEnv preludeTablepreludeSummarypreludeSources preludeSource*=~?=~=~=~~qq0 $fRegexContextregexsourceMatches$fRegexContextregexsourceMatchlookupCaptureIDcvt$fFunctorCapture$fFunctorMatch$fFunctorMatcheslift_phimk_phimk_phi' parse_tpl_fixpoint$=~ $fReplaceText$fReplaceText0 $fReplaceSeq$fReplaceByteString$fReplaceByteString0 $fReplace[]select_edit_scriptspipe_edit_scripts read_file write_filedate_templatestime_templatestimezone_templatesdate_time_8601_templatesdate_time_templates parse_timeshort_month_hmsyslog_severity_hmwords_byREToken _ret_prefix _ret_fixed _ret_grouping_ret_capturingCol C_commentC_parserC_failsC_anti_examples C_examplesC_regexC_capsC_nameTableRow present_colmacro_table_hdrmacro_table_rowmacro_attribute format_table field_widthwrap_rowwidths format_rowfieldselljust min_captures format_tokens delete_ketscan_re match_tdfa match_pcre mdRegexSourcetest' test_neg'test_diagnostic PreludeMacropresentPreludeMacroprelude_prefix decimal_macro url_macroPM_syslog_severityPM_urlPM_email_simplePM_address_ipv4 PM_shortmonthPM_datetime_clfPM_datetime_8601 PM_datetime PM_timezonePM_timePM_date_slashesPM_datePM_id'PM_idPM_string_simple PM_string PM_decimal PM_integerPM_natural_hex PM_natural preludeMacrospreludeMacroTablepreludeMacroSummarypreludeMacroSourcespreludeMacroSourcepreludeMacroEnvprelude_macro_env_pcreprelude_macro_env_tdfaprelude_macro_envpreludeMacroDescriptorprelude_macro_id natural_macronatural_hex_macro integer_macro string_macrostring_simple_macroid_macro id'_macro date_macrodate_slashes_macro time_macrotimezone_macrodatetime_macrodatetime_8601_macrodatetime_clf_macroshortmonth_macroaddress_ipv4_macrossyslog_severity_macroemail_simple_macro test_stub run_testsbracketedRegexSourcefixLine_ln_no _ln_matchesreport lines_matchedFormatTokenOptions_fto_regex_type _fto_min_caps_fto_incl_capsTokenOtherBSBraPCapPGrpECap validToken analyseTokensscan parse_capture formatTokensdefFormatTokenOptionsidFormatTokenOptions formatTokens' formatTokens0formatScanTestTreeanalyseTokensTestTree$fSerialmToken _re_options _re_source _re_cnames _re_regexdef_comp_optiondef_exec_option compileRegex_re'unsafeCompileRegexSimpleunsafeCompileRegexunsafeCompileRegex_ compileRegex'"$fIsOption()RECompOptionExecOption($fIsOptionOptions_RECompOptionExecOption*$fIsOptionExecOptionRECompOptionExecOption*$fIsOptionCompOptionRECompOptionExecOption'$fIsOptionHashMapRECompOptionExecOption$$fIsOptionModeRECompOptionExecOption2$fIsOptionSimpleRegexOptionsRECompOptionExecOptionaddCaptureNamesToMatchesaddCaptureNamesToMatch$fIsRegexREByteString$fIsRegexRESeq $fIsRegexRE[]$fIsRegexREText