| ||||||||||||||||||||||
| ||||||||||||||||||||||
Description | ||||||||||||||||||||||
basic usage: string =~ 'regular expression' returns different things depending on context type - what it evaluates to --------------------------- Int - number of times the regular expression matches String - matching portion of string (String,String,String) - (text before match, matching text, text after match) [Either String String] - list of matching and nonmatching strings, if concated, the original string results. Left = notmatching, Right = matching. Bool - whether the string matches () - always returns () (useful in monad context, see below) [String] - list of matches Array Int String - list of substring matches for first match (String, Array Int String) - full matching text and substring matches [(String, Array Int String)] - all matches, full match plus substrings [Array Int String] - all substrings from all matches also, there is the monadic version (=~~) which always behaves exactly the same as (=~) except when the match fails, instead of returning a default value, the monad fails. regular expressions: these may be strings, which are interpreted as regular expressions, or Regex's from the Text.Regex module. or any other instance of the RegexLike class. when using strings, you may prefix the regex by (?flags) where flags is one of i for a case insensitive match and m means a multi-line match. other flags may be available depending on your implementation advanced features: not just strings can be matched, but rather lists of anything a matcher is defined for. RegexLikeImp data class can be used for in-place code generated by template haskell for compile-time checked regular expresions | ||||||||||||||||||||||
Synopsis | ||||||||||||||||||||||
| ||||||||||||||||||||||
Documentation | ||||||||||||||||||||||
class RegexLike r a | r -> a where | ||||||||||||||||||||||
| ||||||||||||||||||||||
class RegexContext x a where | ||||||||||||||||||||||
| ||||||||||||||||||||||
(!~) :: RegexLike r x => [x] -> r -> Bool | ||||||||||||||||||||||
check if regular expression does not match | ||||||||||||||||||||||
data MatchResult a | ||||||||||||||||||||||
| ||||||||||||||||||||||
Produced by Haddock version 0.6 |