Pub Package Build Status Coverage Status Github Issues


A library for Dart developers that helps to construct difficult regular expressions.

Dart package info is here:

Quick start

  var regex = VerbalExpression()
   ..maybe("www.").anythingBut(" ")

  // Create an example URL
  String url = "";

  // Use VerbalExpression's hasMatch() method to test if the entire string matches the regex
  regex.hasMatch(url); //True

  regex.toString();   // Outputs the regex used: ^http(s)?\\:\\/\\/(www\\.)?([^\\ ]*)\$

  var regex = VerbalExpression()..startOfLine()..then("abc")..or("def");

  var testString = "defzzz";
  //Use VerbalExpression's hasMatch() method to test if parts if the string match the regex
  regex.hasMatch(testString);   // true

Feel free to use any predefined char groups:

  var regex = VerbalExpression()

Define captures:

  var expression = VerbalExpression()
  RegExp regex = expression.toRegExp();

  var match = regex.firstMatch(text);
  print(; // returns "abcd"
  print(; // returns "b"


More examples are in example file

Features and bugs

Please find feature requests and bugs at the issue tracker.

Other implementations

You can view all implementations on

[ Javascript - PHP - Python - C# - Objective-C - Ruby - Groovy - Haskell - C++ - ... (moarr) ]


The dart_verbal_expressions library.