*#non-portable (GHC QuasiQuotes)unstablemjm2002@gmail.com Adjust these to your tastes. An # interface to options seems to be # the next logical (and practical)  step.  Transform a string (presumably)  containing a regex to a PatQ.  NOTE: Given a regex, a pattern ! is constructed which matches  a literal string containing  the verbatim regex. It does  this because I couldn't think ! of anything better for it to  do off the cuff. This needs  thought. Transform a string rep  of a regex to an ExpQ. The  resulting ExpQ, when spliced,  results in a function of type  String -> Maybe [String],  where the input is the String  to match on. The result is  Nothing on error, and Just  a list of results on success.  Note: I' m packing/ unpacking/...  the ByteString unnecessarily  for convenience in testing  out the first go at this.  This will be dealt with in  the future.  L ghci> maybe [] tail $ [$rx|^([+-])?([0-9]+)\.([0-9]+)|] (show $ negate pi)  ["-","3","141592653589793"] $Regex compilation. Temporarily uses  hardcoded options extended and   multiline. Regex matching.  Adjust these to your tastes. An # interface to options seems to be # the next logical (and practical)  step. S  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW                   ! " # $ % & ' ( ) * + , - . / 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 [ \ ] ^ _ ` a b c d e f g h i jk jl m n o p q r s t u v w x y z { | } ~        j j j j j        o                                                                 n                                                                          ! " # $ % & ' ( ) * + , - . / 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 ;VW regexqq-0.1Text.Regex.PCRE.QQ regexToPatQ regexToExpQrxpcreOptsregexmatch pcreExecOptstemplate-haskellLanguage.Haskell.TH.SyntaxreturnQbindQ sequenceQliftnewNamemkName mkNameG_v mkNameG_d mkNameG_tcmkNameLLanguage.Haskell.TH.LibcharLstringLintegerLintPrimL wordPrimL floatPrimL doublePrimL rationalLlitPvarPtupPconPtildePasPwildPrecPlistPsigPfieldPatclausevarEconElitEappEinfixEinfixAppsectionLsectionRlamEtupEcondEletEcaseEdoEcompEfromE fromThenEfromToE fromThenToElistEsigErecConErecUpdEfieldExpguardedBnormalBbindSletSnoBindSparSfunDvalDdataDnewtypeDtySynDclassD instanceDsigDcxtisStrict notStrictnormalCrecCinfixC strictType varStrictTypeforallCforallTvarTconTappTtupleTarrowTlistTforImpDcCallstdCallunsafesafe threadsafenormalGEpatGEinfixPfunDepLanguage.Haskell.TH.QuotequoteExpquotePatExpMatchClauseQExpQDecQPatMatchQClauseQStmtQConQTypeQTypeDecVarStrictTypeQ StrictTypeQFieldExpFieldPatNamePatQ FieldPatQ FieldExpQFunDepQuasiLit QuasiQuoter dataToExpQ dataToPatQdataToQaBodyGuardedBNormalBCallconvCCallStdCallCharPosConForallCInfixCNormalCRecCCxtClassDDataDForeignDFunD InstanceDNewtypeDSigDTySynDValDAppE ArithSeqECaseECompEConECondEDoEInfixELamELetEListELitERecConERecUpdESigETupEVarEFixityFixityDirectionInfixLInfixNInfixRForeignExportFImportFGuardNormalGPatGInfoClassIClassOpIDataConI PrimTyConITyConITyVarIVarILiftCharL DoublePrimL FloatPrimLIntPrimLIntegerL RationalLStringL WordPrimLLocloc_end loc_filename loc_module loc_package loc_startModName NameFlavourNameGNameLNameQNameSNameUNameIsAloneAppliedInfix NameSpaceDataName TcClsNameVarNameOccNameAsPConPInfixPListPLitPRecPSigPTildePTupPVarPWildPPkgName qLocationqNewNameqRecoverqReifyqReportqRunIORangeFromR FromThenR FromThenToRFromToRSafetySafe ThreadsafeUnsafeStmtBindSLetSNoBindSParSStrictIsStrict NotStrict StrictTypeAppTArrowTConTForallTListTTupleTVarTUniq VarStrictType defaultFixitylocation maxPrecedence mkModNamemkNameU mkOccName mkPkgName modStringnameBase nameModule occString pkgStringrecoverreifyreportrunIOrunQshowName showName' tupleDataName tupleTypeNameBodyQCxtQGuardQInfoQRangeQalphaappsE arithSeqEcombinedynfromR fromThenR fromThenToRfromToRgenpatgloballam1EnormalGpatGrename simpleMatchstringELanguage.Haskell.TH.PprPprpprppr_list PrecedenceappPrec nestDepthnoPrecopPrecparensIfpprBodypprCxtpprExp pprFields pprFixity pprInfixExppprLit pprMaybeExp pprParendTypepprPat pprStrictTypepprTyApppprVarStrictTypeppr_sigpprint showtextlsplit where_clause