Regex

data Regex
regex-posix Text.Regex.Posix.Wrap, regex-posix Text.Regex.Posix.String, regex-posix Text.Regex.Posix.Sequence, regex-posix Text.Regex.Posix.ByteString, regex-posix Text.Regex.Posix.ByteString.Lazy
A compiled regular expression.
data Regex :: *
regex-compat Text.Regex
A compiled regular expression.
module Text.Regex
regex-compat Text.Regex
Regular expression matching. Uses the POSIX regular expression interface in Text.Regex.Posix.
class RegexLike regex source => RegexContext regex source target
regex-base Text.Regex.Base.RegexLike
RegexContext is the polymorphic interface to do matching. Since target is polymorphic you may need to suply the type explicitly in contexts The monadic matchM version uses fail to report when the regex has no match in source. Two examples: Here the contest Bool is inferred: > [ c | let notVowel = makeRegex "[^aeiou]" :: Regex, c <- ['a'..'z'], match notVowel [c] ] > > "bcdfghjklmnpqrstvwxyz" Here the context '[String]' must be supplied: > let notVowel = (makeRegex "[^aeiou]" :: Regex ) > in do { c <- ['a'..'z'] ; matchM notVowel [c] } :: [String] > > ["b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"]
class Extract source => RegexLike regex source
regex-base Text.Regex.Base.RegexLike
RegexLike is parametrized on a regular expression type and a source type to run the matching on. There are default implementations: matchTest and matchOnceText use matchOnce; matchCount and matchAllText use matchAll. matchOnce uses matchOnceText and matchAll uses matchAllText. So a minimal complete instance need to provide at least (matchOnce or matchOnceText) and (matchAll or matchAllText). Additional definitions are often provided > [ c | let notVowel = makeRegex "[^aeiou]" :: Regex, c <- ['a'..'z'], matchTest notVowel [c] ] > > "bcdfghjklmnpqrstvwxyz" The strictness of these functions is instance dependent.
class RegexOptions regex compOpt execOpt => RegexMaker regex compOpt execOpt source | regex -> compOpt execOpt, compOpt -> regex execOpt, execOpt -> regex compOpt
regex-base Text.Regex.Base.RegexLike
RegexMaker captures the creation of the compiled regular expression from a source type and an option type. makeRegexM and makeRegexM report parse error using MonadError, usually (Either String regex). The makeRegex function has a default implementation that depends on makeRegexOpts and used defaultCompOpt and defaultExecOpt. Similarly for makeRegexM and makeRegexOptsM. There are also default implementaions for makeRegexOpts and makeRegexOptsM in terms of each other. So a minimal instance definition needs to only define one of these, hopefully makeRegexOptsM.
class RegexOptions regex compOpt execOpt | regex -> compOpt execOpt, compOpt -> regex execOpt, execOpt -> regex compOpt
regex-base Text.Regex.Base.RegexLike
Rather than carry them around spearately, the options for how to execute a regex are kept as part of the regex. There are two types of options. Those that can only be specified at compilation time and never changed are CompOpt. Those that can be changed later and affect how matching is performed are ExecOpt. The actually types for these depend on the backend.
module Text.Regex.Base.RegexLike
regex-base Text.Regex.Base.RegexLike
Classes and instances for Regex matching. All the classes are declared here, and some common type aliases, and the MatchResult data type. The only instances here are for Extract String and Extract ByteString. There are no data values. The RegexContext instances are in Text.Regex.Base.Context, except for ones which run afoul of a repeated variable (RegexContext regex a a), which are defined in each modules' String and ByteString modules.
package regex-applicative
package
regex-applicative is a Haskell library for parsing using regular expressions. Parsers can be built using Applicative interface. Version 0.3.0.2
package regex-base
package
Interface API for regex-posix,pcre,parsec,tdfa,dfa Version 0.93.2
package regex-compat
package
One module layer over regex-posix to replace Text.Regex Version 0.95.1
package regex-compat-tdfa
package
One module layer over regex-tdfa to replace Text.Regex. regex-compat can't use Unicode characters correctly because of using regex-posix. This is not good for Unicode users. I modified regex-compat to use regex-tdfa for solving today's problem. Version 0.95.1.4
package regex-deriv
package
Regex algorithm implementation using derivatives. Version 0.0.4
package regex-dfa
package
The lazy DFA engine, based on CTKLight, for regex-base Version 0.91
package regex-genex
package
From a regex, generate all possible strings it can match Version 0.6.0
package regex-parsec
package
A better performance, lazy, powerful replacement of Text.Regex and JRegex Version 0.90
package regex-pcre
package
The PCRE backend to accompany regex-base, see www.pcre.org Version 0.94.4
package regex-pcre-builtin
package
The PCRE backend to accompany regex-base, with bundled code from www.pcre.org Version 0.94.4.7.8.31
package regex-pderiv
package
Regex algorithm implementation using partial derivatives. The svn source also shipped with two other referential implementations, e.g. Thomspon NFA and Glushkov NFA. For more detail please check out http:code.google.compxhaskell-library/ Version 0.1.3
package regex-posix
package
The posix regex backend for regex-base Version 0.95.2
package regex-posix-unittest
package
Most platforms have a buggy system regex library and this probes the bugs by using the regex-posix package, run with &quot;regex-posix-unittest&quot; Version 1.1
package regex-tdfa
package
A new all Haskell &quot;tagged&quot; DFA regex engine, inspired by libtre Version 1.1.8
package regex-tdfa-text
package
This provides text interface for regex-tdfa. This should be part of regex-tdfa package. But my patches are not accepted yet. So, I made a separate package. If you are interested in my patches, see http://hub.darcs.net/shelarcy/regex-base and http://hub.darcs.net/shelarcy/regex-tdfa. Version 1.0.0.2
package regex-tdfa-unittest
package
Apply regex-posix-unittest tests to regex-tdfa Version 1.1
package regex-tdfa-utf8
package
This combines regex-tdfa with utf8-string to allow searching over UTF8 encoded lazy bytestrings. Version 1.0
package regex-tre
package
The TRE backend to accompany regex-base Version 0.91
package regex-xmlschema
package
This library supports full W3C XML Schema regular expressions inclusive all Unicode character sets and blocks. The complete grammar can be found under http://www.w3.org/TR/xmlschema11-2/#regexs. It is implemented by the technique of derivations of regular expressions. The W3C syntax is extended to support not only union of regular sets, but also intersection, set difference, exor. Matching of subexpressions is also supported. The library can be used for constricting lightweight scanners and tokenizers. It is a standalone library, no external regex libraries are used. Version 0.1.5
package regexchar
package
Provides a POSIX, extended regex-engine, specialised from the underlying polymorphic package regexdot, to merely process the traditional character-lists. Version 0.9.0.10
package regexdot
package
Provides a portable, POSIX, extended regex-engine, designed to process a list of arbitrary objects. Version 0.11.1.0
regexec :: Regex -> (Seq Char) -> IO (Either WrapError (Maybe (Seq Char, Seq Char, Seq Char, [(Seq Char)])))
regex-posix Text.Regex.Posix.Sequence
Matches a regular expression against a string
regexec :: Regex -> ByteString -> IO (Either WrapError (Maybe (ByteString, ByteString, ByteString, [ByteString])))
regex-posix Text.Regex.Posix.ByteString, regex-posix Text.Regex.Posix.ByteString.Lazy
regexec :: Regex -> String -> IO (Either WrapError (Maybe (String, String, String, [String])))
regex-posix Text.Regex.Posix.String
Matches a regular expression against a string
package regexp-tries
package
Regular Expressions on Tries. Version 0.2
package regexpr
package
Regular expression library like Perl and Ruby's regular expressions. This package has a module RegexPR. And RegexPR export functions matchRegexPR and gsubRegexPR. > matchRegexPR      :: String -> String -> Maybe ((String, > (String, String)), [(Int, String)]) > multiMatchRegexPR :: String -> String -> [ ((String, (String, > String)), [(Int, String)]) ] > gmatchRegexPR     :: String -> String -> [ ((String, (String, > String)), [(Int, String)]) ] > getbrsRegexPR     :: String -> String -> [ String ] > ggetbrsRegexPR    :: String -> String -> [ [ String ] ] > subRegexPR        :: String -> String -> String -> String > subRegexPRBy      :: String -> (String -> String) -> > String -> String > gsubRegexPR       :: String -> String -> String -> String > gsubRegexPRBy     :: String -> (String -> String) -> > String -> String > splitRegexPR      :: String -> String -> [String] Examples > matchRegexPR &quot;ab(cde)f\\1&quot; &quot;kkkabcdefcdefgh&quot; => > Just ((&quot;abcdefcde&quot;, (&quot;kkk&quot;, > &quot;fgh&quot;)),[(1,&quot;cde&quot;)]) > matchRegexPR &quot;(?<=hij)abc&quot; &quot;kkkabchijabcde&quot; => > Just ((&quot;abc&quot;,(&quot;kkkabchij&quot;,&quot;de&quot;)),[]) > gsubRegexPR &quot;\\G(\\d\\d\\d)&quot; &quot;\\1,&quot; &quot;123456 > 789&quot; => &quot;123,456, 789&quot; > subRegexPR &quot;(?<=(.)(.)(.))e&quot; &quot; \\3\\2\\1 &quot; > &quot;abcdefg&quot; => &quot;abcd dcb fg&quot; > gsubRegexPR &quot;(?ixm)  aBc  . # comment \n\n&quot; &quot;abc!&quot; > &quot;abc\nABCDAbcAbc&quot; => > &quot;abc!abc!abc!bc&quot; > gmatchRegexPR &quot;(?=(?<!(?!abc)))abc&quot; &quot;abcdefdefabc&quot; => > [((&quot;abc&quot;, (&quot;&quot;, &quot;defdefabc&quot;)), > []), ((&quot;abc&quot;, (&quot;defdef&quot;, &quot;&quot;)), [])] > splitRegexPR &quot;\\s*,\\s*&quot; &quot;a,b ,c\t ,d , e&quot; > => [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;] Version 0.5.4
package regexpr-symbolic
package
Equality, containment, intersection among regular expressions via symbolic manipulation Version 0.5
package regexqq
package
A quasiquoter for Text.Regex.PCRE regexes. This makes use of a new GHC extension known as QuasiQuotes. QuasiQuotes do not appear in ghc until 6.9, BUT there is a patch for ghc-6.8.3 which adds quasiquote functionality. A patched version of ghc-6.8.3, made possible by audreyt's patch, is at http://code.haskell.org/~morrow/quasiquotes/ghc-6.8.3_QQ-0.2.tar.bz2. An example of the use of regexqq is located at http://code.haskell.org/~morrow/quasiquotes/regexqq.txt. Haddock docs are at http://code.haskell.org/~morrow/quasiquotes/regexqq/docs/. Version 0.6
getVersion_Text_Regex_Base :: Version
regex-base Text.Regex.Base
getVersion_Text_Regex_Posix :: Version
regex-posix Text.Regex.Posix
package hxt-regex-xmlschema
package
This library supports full W3C XML Schema regular expressions inclusive all Unicode character sets and blocks. The complete grammar can be found under http://www.w3.org/TR/xmlschema11-2/#regexs. It is implemented by the technique of derivations of regular expressions. The W3C syntax is extended to support not only union of regular sets, but also intersection, set difference, exor. Matching of subexpressions is also supported. The library can be used for constricting lightweight scanners and tokenizers. It is a standalone library, no external regex libraries are used. This package is a substitute for the old regex-xmlschema package. Version 9.1.0
makeRegex :: RegexMaker regex compOpt execOpt source => source -> regex
regex-base Text.Regex.Base.RegexLike

Show more results