Skip to content
Tim Bourguignon edited this page Feb 7, 2014 · 66 revisions

###################################### WARNING ###################################

THIS API IS CURRENTLY COMPLETELY "WORK IN PROGRESS" AND SUBJECT TO DAILY CHANGES!!

THE SAMPLE CODE IS USED TO RESEARCH THE API AND WILL BE COMPLETELY REWRITTEN SOON

HERE BE SMALL DRAGONS

##################################################################################

A SimpleExpressions is build by chaining commands one after the other. Two consecutive members are separated by a ..

Basic construct

Two Content members chained one after the other imply "the first one - then - the second one" ; they thus are to be chained with the Then keyword:

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

The functions

Here are all the functions that SimpleExpressions currently supports:

Content

Modifiers

Logical operators

Qualifiers

  • PreRepeaters OneOrMore, ZeroOrMore
  • PostRepeaters AtLeast, AtMost, Exactly

Bounds

Functions and ideas - HERE BE BIG DRAGONS!

Work in Progress

Ideas

  • CaseInsensitive
  • EndOfWord
  • AsWord
  • AsLine
  • Greedy

Perform structural checks (dogfed with SimpleExpressions :D ). Due to the dynamic nature of SimpleExpressions, such a check can only happen after the parsing of the tokens has been done.

  • Group + Together/As/Together-As
  • AtLeast/Exactly/AtLeast-AtMost
  • Repeat + AtLeast/AtLeast-AtMost/Exactly + Times
  • Character(char) <- parameter check 'x'
  • InRange(string) <- parameter format x-y

Other

  • Simplify generation of parameters using arrays/collections?

After discusion with Miwi, evaluate:

  • Sequence -> Text? @?
  • Either-Or(-Then)
  • Alphanumeric/Letter/Number, no "s"
  • ZeroOrMore
  • OneOrMore
  • Precedence And > Or
Clone this wiki locally