FSharpVerbalExpressions


VerbalExpression

Namespace: FsVerbalExpressions

Composable immutable wrapping types and functions for .Net Regex.

Nested types and modules

TypeDescription
VerbEx

Composable immutable wrapping type for System.Text.RegularExpressions.Regex.

Functions and values

Function or valueDescription
add value verbEx
Signature: value:string -> verbEx:VerbEx -> VerbEx

Append unescaped literal expression to the expression.

any value verbEx
Signature: value:string -> verbEx:VerbEx -> VerbEx

Same as anyOf.

anyOf value verbEx
Signature: value:string -> verbEx:VerbEx -> VerbEx

Matches any single character included in the specified set of escaped characters; [value]

anything verbEx
Signature: verbEx:VerbEx -> VerbEx

Zero or more of any character; (.*)

anythingBut value verbEx
Signature: value:string -> verbEx:VerbEx -> VerbEx

Zero or more of any character except escaped character(s); ([^value]*)

backReference ordinal verbEx
Signature: ordinal:int -> verbEx:VerbEx -> VerbEx

Refers to nth occurence of capturing groups; \ordinal

beginCapture verbEx
Signature: verbEx:VerbEx -> VerbEx

Begin capture group; (

beginCaptureNamed groupName verbEx
Signature: groupName:string -> verbEx:VerbEx -> VerbEx

Begin named capture group ;(?

br verbEx
Signature: verbEx:VerbEx -> VerbEx

Same as lineBreak; \n

capture input groupName verbEx
Signature: input:string -> groupName:string -> verbEx:VerbEx -> string

Match and select groupname value.

digit verbEx
Signature: verbEx:VerbEx -> VerbEx

Matches any decimal digit; \d

endCapture verbEx
Signature: verbEx:VerbEx -> VerbEx

End capture group; )

endOfLine verbEx
Signature: verbEx:VerbEx -> VerbEx

Mark the expression to end at the last character of the line; $

exists f verbEx
Signature: f:(VerbEx -> bool) -> verbEx:VerbEx -> bool

Evaluates the boolean function on the VerbEx

find value verbEx
Signature: value:string -> verbEx:VerbEx -> VerbEx

Append escaped literal expression to the expression. (Same as then'.)

firstMatch input verbEx
Signature: input:string -> verbEx:VerbEx -> FsMatch

Searches the specified input string for the first occurrence of the VerbEx.

fold f state verbEx
Signature: f:('State -> VerbEx -> 'State) -> state:'State -> verbEx:VerbEx -> 'State
Type parameters: 'State

Applies a function to a VerbEx and a state returning a state

foldBack f verbEx state
Signature: f:(VerbEx -> 'State -> 'State) -> verbEx:VerbEx -> state:'State -> 'State
Type parameters: 'State

Applies a function to a VerbEx and a state returning a state

groupNames verbEx
Signature: verbEx:VerbEx -> string array

Returns an array of capturing group names for the regular expression.

groupNumbers verbEx
Signature: verbEx:VerbEx -> int array

Returns an array of capturing group numbers that correspond to group names in an array.

isMatch value verbEx
Signature: value:string -> verbEx:VerbEx -> bool

Indicates whether the regular expression finds a match in the input string.

isMatchAt value startAt verbEx
Signature: value:string -> startAt:int -> verbEx:VerbEx -> bool

Indicates whether the regular expression finds a match in the input string beginning at the specified starting position.

iter f verbEx
Signature: f:(VerbEx -> unit) -> verbEx:VerbEx -> unit

Executes a function on a VerbEx.

lineBreak verbEx
Signature: verbEx:VerbEx -> VerbEx

Matches universal line break expression; \n

map f verbEx
Signature: f:(VerbEx -> VerbEx) -> verbEx:VerbEx -> VerbEx

Transforms a Verbex with a mapping function

matchAt input startAt verbEx
Signature: input:string -> startAt:int -> verbEx:VerbEx -> FsMatch

Searches the specified input string for the first occurrence of the VerbEx beginning at the specified starting position.

matchAtFor input startAt length verbEx
Signature: input:string -> startAt:int -> length:int -> verbEx:VerbEx -> FsMatch

Searches the specified input string for the first occurrence of the VerbEx beginning at the starting position for the length.

matches input verbEx
Signature: input:string -> verbEx:VerbEx -> FsMatch []

Searches the specified input string for all occurrences of a regular expression.

matchesAt input startAt verbEx
Signature: input:string -> startAt:int -> verbEx:VerbEx -> FsMatch []

Searches the input string for all occurrence of a regular expression, beginning at the specified starting position.

maybe value verbEx
Signature: value:string -> verbEx:VerbEx -> VerbEx

Add escaped string to the expression that might appear once (or not); (value)?

multiple value verbEx
Signature: value:string -> verbEx:VerbEx -> VerbEx

The escaped expression 1 or more times; (value)+

multipleVerbEx sourceVerbEx verbEx
Signature: sourceVerbEx:VerbEx -> verbEx:VerbEx -> VerbEx

The VerbEx 1 or more times; (sourceVerbEx)+

namedBackReference groupname verbEx
Signature: groupname:string -> verbEx:VerbEx -> VerbEx

Refers to named capturing group; \k

namedBlock name arg2
Signature: name:SupportedNamedBlock -> VerbEx -> VerbEx

Matches any single character in the supported named block; \p{name}

nonDigit verbEx
Signature: verbEx:VerbEx -> VerbEx

Matches any nondigit; \D

nonWhiteSpace verbEx
Signature: verbEx:VerbEx -> VerbEx

Matches any non-white-space character; \S.

nonWordCharacter verbEx
Signature: verbEx:VerbEx -> VerbEx

Matches any nonword character; \W

notNamedBlock name arg2
Signature: name:SupportedNamedBlock -> VerbEx -> VerbEx

Matches any single character that is not in the supported named block; \P{name}

notUnicodeCategory category arg2
Signature: category:UniCodeGeneralCategory -> VerbEx -> VerbEx

Matches any single character that is not in the Unicode general category; \P{name}

or' regularExpression verbEx
Signature: regularExpression:string -> verbEx:VerbEx -> VerbEx

Or's the regular expression to the regular expression in a VerbEx.

range collection verbEx
Signature: collection:seq<obj> -> verbEx:VerbEx -> VerbEx

Add expression to match a range (or multiple ranges), unescaped values.

repeatBetweenPrevious n m arg3
Signature: n:int -> m:int -> VerbEx -> VerbEx

Repeat previous number of times between n and m; {n,m}

repeatPrevious n arg2
Signature: n:int -> VerbEx -> VerbEx

Repeat previous exact number of times; {n}

replace input replacement verbEx
Signature: input:string -> replacement:string -> verbEx:VerbEx -> string

In input string replaces all strings that match regular expression pattern with replacement string.

replaceByMatch input evalutor verbEx
Signature: input:string -> evalutor:MatchEvaluator -> verbEx:VerbEx -> string

In input string replaces all strings that match regular expression with string returned by MatchEvaluator delegate.

replaceByMatchMaxTimes (...)
Signature: input:string -> evalutor:MatchEvaluator -> count:int -> verbEx:VerbEx -> string

In input string replaces a specified maximum number of strings that match a regular expression with string returned by MatchEvaluator delegate.

replaceByMatchMaxTimesStartAt (...)
Signature: input:string -> evalutor:MatchEvaluator -> count:int -> startAt:int -> verbEx:VerbEx -> string

In input string beginning at start at position replaces a specified maximum number of strings that match a regular expression with string returned by MatchEvaluator delegate.

replaceMaxTimes (...)
Signature: input:string -> replacement:string -> count:int -> verbEx:VerbEx -> string

In input string replaces a specified maximum number of strings that match regular expression with replacement string.

replaceMaxTimesStartAt (...)
Signature: input:string -> replacement:string -> count:int -> startAt:int -> verbEx:VerbEx -> string

In input string beginning at start at position replaces a specified maximum number of strings that match regular expression with replacement string.

resetRegexOptions newRegexOptions verbEx
Signature: newRegexOptions:RegexOptions option -> verbEx:VerbEx -> VerbEx

Return new VerbEx with new RegExOptions.

something verbEx
Signature: verbEx:VerbEx -> VerbEx

One or more of any character; (.+)

somethingBut value verbEx
Signature: value:string -> verbEx:VerbEx -> VerbEx

One or more of any character except escaped character; ([^%s]+)

split input verbEx
Signature: input:string -> verbEx:VerbEx -> string array

Splits input string into an array of substrings at the positions defined by regular expression.

splitMaxTimes input count verbEx
Signature: input:string -> count:int -> verbEx:VerbEx -> string array

Splits input string a specified maximum number of times into an array of substrings at the positions defined by regular expression.

splitMaxTimesStartAt (...)
Signature: input:string -> count:int -> startAt:int -> verbEx:VerbEx -> string array

Splits input string, begining at start position, a specified maximum number of times into an array of substrings at the positions defined by regular expression.

startOfLine verbEx
Signature: verbEx:VerbEx -> VerbEx

Mark the expression to start at the beginning of the line; ^

tab verbEx
Signature: verbEx:VerbEx -> VerbEx

Matches a tab character; \t

then' value verbEx
Signature: value:string -> verbEx:VerbEx -> VerbEx

Append escaped literal expression to the expression. (Same as find.)

toString verbEx
Signature: verbEx:VerbEx -> string

Value of regular expression.

unicode nnnn arg2
Signature: nnnn:string -> VerbEx -> VerbEx

Matches a Unicode character by using hexadecimal representation (exactly four digits, as represented by nnnn); \unnnn

unicodeCategory category arg2
Signature: category:UniCodeGeneralCategory -> VerbEx -> VerbEx

Matches any single character in the Unicode general category; \p{name}

verbExOrVerbEx (...)
Signature: regexOptions:RegexOptions -> verbEx:VerbEx -> verbEx:VerbEx -> VerbEx

Return new VerbEx of two VerbExs or'ed.

whiteSpace verbEx
Signature: verbEx:VerbEx -> VerbEx

Matches any white-space character; \s

word verbEx
Signature: verbEx:VerbEx -> VerbEx

Expression to match a word; \w+

wordCharacter verbEx
Signature: verbEx:VerbEx -> VerbEx

Matches any word character; \w

Fork me on GitHub