regexchar-0.9.0.13: A POSIX, extended regex-engine.

Safe HaskellNone
LanguageHaskell2010

RegExChar.MetaChar

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
\d
=> Any isDigit-character.
\D
=> Any non-isDigit character.
\s
=> Any isSpace-character.
\S
=> Any non-isSpace character.
\w
=> Any isWord letter.
\W
=> Any non-isWord letter.
  • Enables one to compose concise regexen, containing any Char that's a member of one of these predefined sets.
  • Though Meta is polymorphic, & the type-parameter can't be assumed to implement either Enum or Ord, Char actually does, so this module is able to implement ranges within a Bracket-expression.
  • Defines specialised instances of Read & Show, to cope with Perl-style shortcuts, Posix Character-classes & Bracket-expression range-specifications.
TODO
Use Environment.getLocale. Regrettably, this returns in the IO-monad, & even it didn't, how does one pass that information to Read ?!

Synopsis

Types

Type-synonyms

newtype MetaChar Source

A specialised instance, encapsulated to permit tailored instance-declarations.

Constructors

MkMetaChar (Meta Char) 

Constants

Functions

metaCharParser :: Parser MetaChar Source

Builds a parser of traditional regex-syntax, which understands Char-specific concepts like Perl-style shortcuts & Posix Character-classes.

Accessors (Deconstructors)