Skip to content
Tim Bourguignon edited this page Mar 11, 2014 · 66 revisions

The Basics

A SimpleExpression object is mostly used to create a regular expression. Nevertheless it also wraps a Regex object and can thus provide basic matching and validation functions.

A SimpleExpressions is build by chaining commands one after the other, each consecutive members separated by a dot .. Two Content members chained one after the other imply "the first one - then - the second one":

Text("http").Text("://") //means that we want to match "http://"
Text("http").Maybe("s").Text("://") //means we want to match "http://" and "https://"

Creating a command

Here are all the functions that SimpleExpressions currently supports:

Content

Modifiers

Logical operators

Groups and bounds

Potential Roadmap (!Here be Dragons!)

  • PreRepeaters OneOrMore, ZeroOrMore
  • Use Maybe to notify that the next element is optional
  • Use Either-Or-Then structure instead of just Or-Then (to limit the number of groups that must be created)
  • Implement something like a Repeat-X-Cardinal-Times?
  • Anything
  • Word(string)
  • StartsWith
  • EndOfLine
Clone this wiki locally