dart_regex 0.0.1 copy "dart_regex: ^0.0.1" to clipboard
dart_regex: ^0.0.1 copied to clipboard

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

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

6
likes
160
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on dart_regex