!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~           !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None<=?I       NoneI !" !" !" !"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 name+Tthe 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 + dictionary0 look up a , in the + dictionary %&'()*+,-./01 %&'()*+,-./0 ,-.+/()*1%&'0%&'()*+,-./01Safe!"09;<=>Hthe matching of a single sub-expression against part of the source text@ the whole text that was searchedAthe text that was matchedBythe number of characters preceding the match with -1 used if no text was captured by the RE (not even the empty string)C1the number of chacter in the captured sub-stringD(test if the capture has matched any textE$returns the text preceding the matchF returns the text after the match >?@ABCDEFG >?@ABCDEF >?@ABCDEF>?@ABCDEFGNone!"09;<=Jthe 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))Lthe whole source textMthe RE's capture namesN @.n-1 captures, starting with the text matched by the whole REO/Construct a Match that does not match anything.Pan empty array of CaptureQ3tests whether the RE matched the source text at allR3tests whether the RE matched the source text at allSKthe top-level capture if the source text matched the RE, Nothing otherwiseTYthe top-level capture and the sub captures if the text matched the RE, Nothing otherwiseUan alternative for captureTextVlook 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 onW#an alternative for captureTextMaybeXlook up the text of the nth capture (0 being the match of the whole), returning Nothing if the Match doesn't contain the captureYan alternative for captureZlook 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['an alternative for capture captureMaybe\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 on, returning Nothing if there is no such capture, or if the capture failed to capture anything (being in a failed alternate)]=convert a regex-base native MatchText into a regex Match type^6for matching just the first RE against the source textJKLMNOPQRSTUVWXYZ[\]^_JKLMNOPQRSTUVWXYZ[\]JKLMNOPQRSTUVWXYZ[\]JKLMNOPQRSTUVWXYZ[\]^_U9 Y9 None!"09;<=bithe result type to use when every match is needed, not just the first match of the RE against the sourcedthe source text being matchede!all captures found, left to rightf3tests whether the RE matched the source text at allgcount the matcheshlist the Matchesi(extract the main capture from each matchj,for matching all REs against the source text bcdefghijkbcdefghibcdefghibcdefghijkNone!"9:;nthe Locationg 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.rContext= 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 capturesvua selction of the Replace methods can be encapsulated with ReplaceMethods for the higher-order replacement functionszoReplace provides the missing methods needed to replace the matched text; lengthE is the minimum implementation{length function for a|inject String into a}project a onto a String~inject into Textproject Text onto asplit into linesconcatenate a list of linesappend a newline*apply a substitution function to a CaptureKconvert a template containing $0, $1, etc., in the first argument, into a phiJ replacement function for use with replaceAllCaptures and replaceCapturesEreplaceMethods encapsulates ReplaceMethods a from a Replace a contextRTrue iff the location references a complete match (i.e., not a bracketed capture)Kreplace all with a template, $0 for whole text, $1 for first capture, etc.substitutes using a function that takes the full Match context and returns the same replacement text as the _phi_phi context.vreplaceAllCaptures_ is like like replaceAllCaptures but takes the Replace methods through the ReplaceMethods argumentUreplaceAllCapturesM 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 argumentOreplaceCapturesM 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 function-nopqrstuvwxyz{|}~#nopqrstuvwxyz{|}~#z{|}~vwxyrstunopqnopqrstuvwxyz {|}~None<= None$ None0 Safe(C) 2016-17 Chris DornanBSD3 (see the LICENSE file)+Chris Dornan <chris.dornan@irisconnect.com>RFCportableNoneL,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~LbcdeJKLMN>?@ABCOfghiQRSTUVWXYZ[\DEF,z{|}~vwxyrstunopq None0ATza convenience function used by the API modules to insert capture names extracted from the parsed RE into the (*=~) resultza convenience function used by the API modules to insert capture names extracted from the parsed RE into the (?=~) resultYa 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. None!"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 possibleGwhat kind of back end will be compiling the RE, and its match function test RegexType for TDFA/PCREness test RegexType for TDFA/PCREnessO,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~*1None!"I+an enumeration of all of the prelude macros!naming the macros)all prelude macros are prefixed with thisa digit string macrosee  'https://mathiasbynens.be/demo/url-regex (based on @stephenhay URL)9      !-      !-     ! $      !None!"'oa LineEdit is the most general action thar can be performed on a line and is the only means of deleting a line+<each Edit action specifies how the match should be processed/an / 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 pipeline2 apply an + script to a single line3apply 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 line4apply 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'()*+,-./01234` !",>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~'()*+.,-/01234/01+,-.'()*234 !"'()*+,-./01234None!": 67specifies whether to return the linss matched or missed9a 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 b for that line<the  for this line=all the b of the RE on this line>operates 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.@!given a list of lines, apply the 9 to each line of the fileA&generate a grep report from a list of :Bgiven a velocity9 flag filter out either the lines matched or not matched 6789:;<=>?@ABe !",>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~6789:;<=>?@AB>:;<=?9@A678B !"6789:;<=>?@ABNoneGCa simple regex-based scanner interpretter for prototyping scannersHa higher order version of G parameterised over the  matchOnce functionGHT,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~GHGHGHNone!"5IJKLMNOPQRSTUVWIOJKLMNPQRSTUVWPQUIJKLMNORTVWS IJKLMNOPQRSTUVWNone !"9:;<=2\]^_`abcdefghijklmnopqr   stuvwxyz{|}~!P\]^_`abcdefghijklmnopqrstuvwxyz!^_`abcdefgPh]ijkl\mnstuvwxyopqrz-\]^_`abcdefghijklmnopqr   stuvwxyz{|}~None9:;<=find all matches in textfind first match in text)the regex-base polymorphic match operator2the regex-base monadic, polymorphic match operatorq,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~P\]^_`abcdefghijklmnopqrstuvwxyz ]jpqzNone9:;<=find all matches in textfind first match in text)the regex-base polymorphic match operator2the regex-base monadic, polymorphic match operatorq,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~P\]^_`abcdefghijklmnopqrstuvwxyz ]jpqzNone9:;<=find all matches in textfind first match in text)the regex-base polymorphic match operator2the regex-base monadic, polymorphic match operatorq,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~P\]^_`abcdefghijklmnopqrstuvwxyz ]jpqzNone9:;<=find all matches in textfind first match in text)the regex-base polymorphic match operator2the regex-base monadic, polymorphic match operatorq,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~P\]^_`abcdefghijklmnopqrstuvwxyz ]jpqzNone9:;<=find all matches in textfind first match in text)the regex-base polymorphic match operator2the regex-base monadic, polymorphic match operatorq,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~P\]^_`abcdefghijklmnopqrstuvwxyz ]jpqzNone9:;<=find all matches in textfind first match in text)the regex-base polymorphic match operator2the regex-base monadic, polymorphic match operatorq,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~P\]^_`abcdefghijklmnopqrstuvwxyz ]jpqzNone:find all matches in textfind first match in text)the regex-base polymorphic match operator2the regex-base monadic, polymorphic match operatorq,>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~P\]^_`abcdefghijklmnopqrstuvwxyzNone!":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  h !",>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~'()*+.,-/01234/01+,-.'()*234 !"  Noneo !",>?@ABCDEFJKLMNOQRSTUVWXYZ[\bcdefghinopqrstuvwxyz{|}~'()*+.,-/012349>?@BGH#>?9@BGH/01+,-.'()*234 !" !"#$$%&'()*+,-./0123456789:;<=>?@ABBCDDEFGHIJKLMNOPQRSTUVWXYYZ[\]^_`abcddefghijklmnopqrstuvwxyz{{|}~                                               !"#$%&'()*+,-./0123456789:;<=>8?@ABCDEFGHIJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij)klmnopqrstuvwxyz{|}~                                               k$regex-0.8.0.0-LDxvkulxcP7Jv0oundECFmText.RE.Types.OptionsText.RE.Types.LineNoText.RE.Types.CaptureIDText.RE.Types.CaptureText.RE.Types.MatchText.RE.Types.MatchesText.RE.Types.ReplaceText.RE.Types.IsRegexText.RE.TestBench.ParsersText.RE.Internal.QQText.RE.Internal.EscapeREString Text.RE.Internal.AddCaptureNamesText.RE.TestBenchText.RE.Internal.PreludeMacrosText.RE.Tools.EditText.RE.Tools.GrepText.RE.Tools.LexText.RE.Internal.NamedCapturesText.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.Tools.SedText.RE Text.RE.ToolsSimpleRegexOptionsMultilineSensitiveMultilineInsensitiveBlockSensitiveBlockInsensitiveMacrosMacroID getMacroIDIsOption makeOptionsOptions_Options optionsMacs optionsComp optionsExec emptyMacros$fLiftSimpleRegexOptions$fHashableMacroID$fIsStringMacroID $fOrdMacroID $fEqMacroID $fShowMacroID$fShowOptions_$fBoundedSimpleRegexOptions$fEnumSimpleRegexOptions$fEqSimpleRegexOptions$fOrdSimpleRegexOptions$fShowSimpleRegexOptionsLineNoZeroBasedLineNogetZeroBasedLineNo firstLine getLineNolineNo $fShowLineNo $fEnumLineNoCaptureOrdinalgetCaptureOrdinal CaptureNamegetCaptureName CaptureNames CaptureIDIsCaptureOrdinal IsCaptureNamenoCaptureNames findCaptureID$fHashableCaptureName$fShowCaptureName$fOrdCaptureName$fEqCaptureName$fShowCaptureOrdinal$fOrdCaptureOrdinal$fEqCaptureOrdinal$fEnumCaptureOrdinal$fIxCaptureOrdinal$fNumCaptureOrdinal$fShowCaptureID$fOrdCaptureID $fEqCaptureIDCapture captureSource capturedText captureOffset captureLength hasCaptured capturePrefix captureSuffix$fFunctorCapture $fShowCapture $fEqCaptureMatch matchSource captureNames matchArraynoMatchemptyMatchArraymatched matchedText matchCapture matchCaptures!$$ captureText!$$?captureTextMaybe!$capture!$? captureMaybeconvertMatchText$fRegexContextregexsourceMatch$fFunctorMatch $fShowMatch $fEqMatchMatches matchesSource allMatches anyMatches countMatchesmatches mainCaptures $fRegexContextregexsourceMatches$fFunctorMatches $fShowMatches $fEqMatchesLocation locationMatchlocationCaptureContextTOPSUBALLReplaceMethods methodLength methodSubstReplacelengthEpackEunpackEtextifyE detextifyElinesEunlinesEappendNewlineEsubstEparseTemplateEreplaceMethods isTopLocation replaceAllreplaceAllCapturesreplaceAllCaptures_replaceAllCapturesMreplacereplaceCapturesreplaceCaptures_replaceCapturesM expandMacros expandMacros' $fReplaceText$fReplaceText0 $fReplaceSeq$fReplaceByteString$fReplaceByteString0 $fReplace[] $fShowContext$fShowLocationIsRegex matchOnce matchMany makeRegex makeRegexWith regexSourceSeverityEmergAlertCritErrWarningNoticeInfoDebug IPV4Address parseIntegerparseHex parseDouble parseStringparseSimpleString parseDateparseSlashesDateparseTimeOfDay parseTimeZone parseDateTimeparseDateTime8601parseDateTimeCLFparseShortMonthshortMonthArrayparseIPv4Address parseSeverityseverityKeywords$fBoundedSeverity$fEnumSeverity $fOrdSeverity $fEqSeverity$fShowSeverity QQFailure _qqf_context_qqf_componentqq0$fExceptionQQFailure$fShowQQFailureescapeREString isMetaCharaddCaptureNamesToMatchesaddCaptureNamesToMatchaddCaptureNames FunctionID _FunctionID RegexSource _RegexSource TestResult _TestResultMacroDescriptor _md_source _md_samples_md_counter_samples_md_test_results _md_parser_md_descriptionMacroEnv WithCaptures InclCaptures ExclCaptures RegexTypeisTDFAisPCREmkTDFAmkPCREpresentRegexTypemkMacros testMacroEnv badMacrosrunTests runTests'dumpMacroTableformatMacroTableformatMacroSummaryformatMacroSourcesformatMacroSourcetestMacroDescriptors mdRegexSource$fShowRegexType$fEqWithCaptures$fOrdWithCaptures$fShowWithCaptures$fIsStringTestResult$fShowTestResult$fIsStringRegexSource$fShowRegexSource$fIsStringFunctionID$fShowFunctionID$fShowMacroDescriptor $fShowREToken$fIxCol $fBoundedCol $fEnumCol$fOrdCol$fEqCol $fShowCol 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 preludeMacrospreludeMacroTablepreludeMacroSummarypreludeMacroSourcespreludeMacroSourcepreludeMacroEnvpreludeMacroDescriptorpresentPreludeMacro$fBoundedPreludeMacro$fEnumPreludeMacro$fOrdPreludeMacro$fEqPreludeMacro$fShowPreludeMacroLineEditNoEdit ReplaceWithDeleteEditTemplateFunctionEditsSelectPipe applyEdits applyEdit applyLineEdit$fShowLineEdit Verbosity LinesMatchedLinesNotMatched GrepScriptLine getLineNumbergetLineMatchesgrep grepLines grepScriptreport linesMatched $fShowLine$fShowVerbosity $fEqVerbosity$fOrdVerbosityalexalex'TokenECapPGrpPCapBraBSOthercpextractNamedCaptures validTokenscan formatTokensidFormatTokenOptions formatTokens' formatTokens0 $fShowToken$fGenericToken $fEqToken$fShowFormatTokenOptionsRErereMSreMIreBSreBIreMultilineSensitivereMultilineInsensitivereBlockSensitivereBlockInsensitivere_ regexType reOptionsreSourcereCaptureNamesreRegexnoPreludeOptionsdefaultOptionsunpackSimpleRegexOptions compileRegexcompileRegexWithcompileRegexWithOptionsprelude preludeEnvpreludeTestsFailing preludeTablepreludeSummarypreludeSources preludeSourceescape"$fIsOption()RECompOptionExecOption($fIsOptionOptions_RECompOptionExecOption*$fIsOptionExecOptionRECompOptionExecOption*$fIsOptionCompOptionRECompOptionExecOption'$fIsOptionHashMapRECompOptionExecOption2$fIsOptionSimpleRegexOptionsRECompOptionExecOption*=~?=~=~=~~$fIsRegexREByteString$fIsRegexRESeq $fIsRegexRE[]$fIsRegexRETextsedsed'lookupCaptureIDlift_phiparseTemplateE'fixpoint$=~date_templatestime_templatestimezone_templatesdate_time_8601_templatesdate_time_templates parse_timeshort_month_hm severity_hmwords_byREToken _ret_prefix _ret_fixed _ret_grouping_ret_capturingColC_nameC_capsC_regex C_examplesC_anti_examplesC_failsC_parser C_commentTableRowTDFAPCRETestBenchMatcher present_colmacro_table_hdrmacro_table_rowmacro_attribute format_table field_widthwrap_rowwidths format_rowfieldselljust min_captures format_tokens delete_ketscan_retest' test_neg'test_diagnosticprelude_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_scriptsFormatTokenOptions_fto_regex_type _fto_min_caps_fto_incl_caps analyseTokens parse_capturedefFormatTokenOptions _re_options _re_source _re_cnames _re_regexdef_comp_optiondef_exec_option compileRegex_re'unsafeCompileRegexSimpleunsafeCompileRegexunsafeCompileRegex_ compileRegex' read_file write_file