-
Notifications
You must be signed in to change notification settings - Fork 0
Home
###################################### 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 .
.
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://"
Here are all the functions that SimpleExpressions currently supports:
Content
Alphanumerics
,Letters
,Numbers
One(char/string)
,OneOf(string)
Text(string)
Maybe
Anything
EitherOf(string)
Modifiers
Logical operators
Then
Either
.X.Or
.Y.Then
Qualifiers
- PreRepeaters
OneOrMore
,ZeroOrMore
- PostRepeaters
AtLeast
,AtMost
,Exactly
Bounds
- Repetitions
- Single-element repetition
Exactly(int)
/AtLeast(int)
.AtMost(int)
- Multi-element repetition
Repeat
.X.Exactly(int)
/AtLeast(int)
.AtMost(int)
.Times
- Groups
Group
.X.Y.Together
.As(string)
Work in Progress
-AndWhitespaces
Word(string)
StartsWith
EndOfLine
Maybe
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