VerbalExpressions / elm-verbal-expressions / VerbalExpressions

Elm port of VerbalExpressions

verex : VerbalExpression

An initial, empty verex to start from and pipe through functions

startOfLine : VerbalExpression -> VerbalExpression

Restrict matches to start of line

endOfLine : VerbalExpression -> VerbalExpression

Restrict matches to end of line

followedBy : String -> VerbalExpression -> VerbalExpression

Include a matching group in the expression

find : String -> VerbalExpression -> VerbalExpression

Start the expression with a matching group

possibly : String -> VerbalExpression -> VerbalExpression

Include an optional matching group

anything : VerbalExpression -> VerbalExpression

Match any set of characters or not

anythingBut : String -> VerbalExpression -> VerbalExpression

Match any set of characters except a particular String

something : VerbalExpression -> VerbalExpression

Match on one or more characters

somethingBut : String -> VerbalExpression -> VerbalExpression

Match on one or more characters, with the execption of some String

lineBreak : VerbalExpression -> VerbalExpression

Match a new line

tab : VerbalExpression -> VerbalExpression

Match a tab

word : VerbalExpression -> VerbalExpression

Match an alphanumeric word

anyOf : String -> VerbalExpression -> VerbalExpression

Match a character class

range : List ( String, String ) -> VerbalExpression -> VerbalExpression

Match a character class with ranges

withAnyCase : Basics.Bool -> VerbalExpression -> VerbalExpression

Let the expression be case insensitive

repeatPrevious : Basics.Int -> VerbalExpression -> VerbalExpression

Repeat the prior case a number of times

repeatPrevious2 : Basics.Int -> Basics.Int -> VerbalExpression -> VerbalExpression

Repeat the prior case within some range of times

multiple : String -> VerbalExpression -> VerbalExpression

Match a group any number of times

multiple2 : String -> Basics.Int -> VerbalExpression -> VerbalExpression

Match a group a particular number of times

orElse : String -> VerbalExpression -> VerbalExpression

Add an alternative expression

beginCapture : VerbalExpression -> VerbalExpression

Start capturing a group

endCapture : VerbalExpression -> VerbalExpression

Finish capturing a group

captureGroup : (VerbalExpression -> VerbalExpression) -> VerbalExpression -> VerbalExpression

Captures a group

toRegex : VerbalExpression -> Regex

Compile result down to a Regex.Regex

toString : VerbalExpression -> String

Compile result down to a String Note, this is just a string of the expression. Modifier flags are discarded.


type alias VerbalExpression =
{ prefixes : String
, source : String
, suffixes : String
, modifiers : { insensitive : Basics.Bool
, multiline : Basics.Bool } 
}

The main type used for constructing verbal expressions