Skip to content

Latest commit

 

History

History
56 lines (46 loc) · 1.26 KB

README.md

File metadata and controls

56 lines (46 loc) · 1.26 KB

A Type-safe DSL for building regular expressions in Dart using composable building blocks.

Usage

final DartRegex emailPatternDSL = DartRegex([
  CaptureGroup(
    OneOrMore(Word()),
  ),
  CharacterSet('@'),
  CaptureGroup(
    OneOrMore(
      AtomGroup(
        [Word(), CharacterSet('.'), Word()],
      ),
    ),
  ),
]);

Available Components

Atoms

  • Word()
  • Digit()
  • Whitespace()
  • AnyCharacter()
  • CharacterSet()
  • AtomGroup()

Quantifiers

  • ZeroOrMore()
  • OneOrMore()
  • ZeroOrOne()
  • Exactly()
  • Range()

Groups

  • CaptureGroup()

Additional information

Feel free to file issues, this is under development, so expect breaking changes till 1.0.0