FsRegEx


VerbalExpressions

Namespace: global

Functions supporting composable verbal expression natural language regular expressions.

Functions and values

Function or valueDescription
add value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> FsRegEx

Append unescaped literal expression to the expression.

any value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> FsRegEx

Same as anyOf.

anyOf value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> FsRegEx

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

anything fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Zero or more of any character; (.*)

anythingBut value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> FsRegEx

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

backReference ordinal fsRegEx
Signature: ordinal:int -> fsRegEx:FsRegEx -> FsRegEx

Refers to nth occurence of capturing groups; \ordinal

beginCapture fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Begin capture group; (

beginCaptureNamed groupName fsRegEx
Signature: groupName:string -> fsRegEx:FsRegEx -> FsRegEx

Begin named capture group ;(?

br fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Same as lineBreak; \n

capture input groupName fsRegEx
Signature: input:string -> groupName:string -> fsRegEx:FsRegEx -> string

Match and select groupname value.

digit fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Matches any decimal digit; \d

endCapture fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

End capture group; )

endOfLine fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

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

exists f fsRegEx
Signature: f:(FsRegEx -> bool) -> fsRegEx:FsRegEx -> bool

Evaluates the boolean function on the FsRegEx

find value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> FsRegEx

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

firstMatch input fsRegEx
Signature: input:string -> fsRegEx:FsRegEx -> FsMatch

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

fold f state fsRegEx
Signature: f:('State -> FsRegEx -> 'State) -> state:'State -> fsRegEx:FsRegEx -> 'State
Type parameters: 'State

Applies a function to a FsRegEx and a state returning a state

foldBack f fsRegEx state
Signature: f:(FsRegEx -> 'State -> 'State) -> fsRegEx:FsRegEx -> state:'State -> 'State
Type parameters: 'State

Applies a function to a FsRegEx and a state returning a state

fsRegExOrFsRegEx (...)
Signature: regexOptions:RegexOptions -> fsRegEx:FsRegEx -> fsRegEx:FsRegEx -> FsRegEx

Return new FsRegEx of two FsRegExs or'ed.

groupNames fsRegEx
Signature: fsRegEx:FsRegEx -> string array

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

groupNumbers fsRegEx
Signature: fsRegEx:FsRegEx -> int array

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

isMatch value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> bool

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

isMatchAt value startAt fsRegEx
Signature: value:string -> startAt:int -> fsRegEx:FsRegEx -> bool

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

iter f fsRegEx
Signature: f:(FsRegEx -> unit) -> fsRegEx:FsRegEx -> unit

Executes a function on a FsRegEx.

lineBreak fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Matches universal line break expression; \n

map f fsRegEx
Signature: f:(FsRegEx -> FsRegEx) -> fsRegEx:FsRegEx -> FsRegEx

Transforms a FsRegEx with a mapping function

matchAt input startAt fsRegEx
Signature: input:string -> startAt:int -> fsRegEx:FsRegEx -> FsMatch

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

matchAtFor input startAt length fsRegEx
Signature: input:string -> startAt:int -> length:int -> fsRegEx:FsRegEx -> FsMatch

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

matches input fsRegEx
Signature: input:string -> fsRegEx:FsRegEx -> FsMatch []

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

matchesAt input startAt fsRegEx
Signature: input:string -> startAt:int -> fsRegEx:FsRegEx -> FsMatch []

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

maybe value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> FsRegEx

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

multiple value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> FsRegEx

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

multipleFsRegEx sourceFsRegEx fsRegEx
Signature: sourceFsRegEx:FsRegEx -> fsRegEx:FsRegEx -> FsRegEx

The FsRegEx 1 or more times; (sourceFsRegEx)+

namedBackReference groupname fsRegEx
Signature: groupname:string -> fsRegEx:FsRegEx -> FsRegEx

Refers to named capturing group; \k

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

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

nonDigit fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Matches any nondigit; \D

nonWhiteSpace fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

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

nonWordCharacter fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Matches any nonword character; \W

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

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

notUnicodeCategory category arg2
Signature: category:UnicodeGeneralCategory -> FsRegEx -> FsRegEx

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

or' regularExpression fsRegEx
Signature: regularExpression:string -> fsRegEx:FsRegEx -> FsRegEx

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

range collection fsRegEx
Signature: collection:seq<obj> -> fsRegEx:FsRegEx -> FsRegEx

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

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

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

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

Repeat previous exact number of times; {n}

replace input replacement fsRegEx
Signature: input:string -> replacement:string -> fsRegEx:FsRegEx -> string

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

replaceByMatch input evalutor fsRegEx
Signature: input:string -> evalutor:MatchEvaluator -> fsRegEx:FsRegEx -> 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 -> fsRegEx:FsRegEx -> 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 -> fsRegEx:FsRegEx -> 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 -> fsRegEx:FsRegEx -> 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 -> fsRegEx:FsRegEx -> string

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

resetRegexOptions (...)
Signature: newRegexOptions:RegexOptions option -> fsRegEx:FsRegEx -> FsRegEx

Return new FsRegEx with new RegExOptions.

something fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

One or more of any character; (.+)

somethingBut value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> FsRegEx

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

split input fsRegEx
Signature: input:string -> fsRegEx:FsRegEx -> string array

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

splitMaxTimes input count fsRegEx
Signature: input:string -> count:int -> fsRegEx:FsRegEx -> 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 -> fsRegEx:FsRegEx -> 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 fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

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

tab fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Matches a tab character; \t

then' value fsRegEx
Signature: value:string -> fsRegEx:FsRegEx -> FsRegEx

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

toString fsRegEx
Signature: fsRegEx:FsRegEx -> string

Value of regular expression.

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

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

unicodeCategory category arg2
Signature: category:UnicodeGeneralCategory -> FsRegEx -> FsRegEx

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

whiteSpace fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Matches any white-space character; \s

word fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Expression to match a word; \w+

wordCharacter fsRegEx
Signature: fsRegEx:FsRegEx -> FsRegEx

Matches any word character; \w

Fork me on GitHub