Farkle


Regex Type

A regular expression that is used to specify a tokenizer symbol.

Checking two regular expressions for equality does not mean that they recognize the same symbols, but that their internal structure is the same.

Instance members

Instance member Description

this.And

Full Usage: this.And

Parameters:
Returns: Regex

Concatenates two regexes into a new one that recognizes a string of the first one, and then a string of the second.

x2 : Regex
Returns: Regex

this.AtLeast

Full Usage: this.AtLeast

Parameters:
    num : int

Returns: Regex

Returns a regex that recognizes at least a number of consecutive strings that are recognized by the given regex.

num : int
Returns: Regex

this.Between

Full Usage: this.Between

Parameters:
    from : int
    upTo : int

Returns: Regex

Returns a regex that recognizes a ranged number of strings that are recognized by the given regex. The range is closed.

from : int
upTo : int
Returns: Regex

this.Optional

Full Usage: this.Optional

Returns: Regex

Returns a regex that recognizes either the given regex or the empty string.

Returns: Regex

this.Or

Full Usage: this.Or

Parameters:
Returns: Regex

Returns a regex that recognizes either a string of the first or the second given regex.

x2 : Regex
Returns: Regex

this.Repeat

Full Usage: this.Repeat

Parameters:
    num : int

Returns: Regex

Returns a regex that recognizes an exact number of strings that are recognized by the given regex.

num : int
Returns: Regex

this.ZeroOrMore

Full Usage: this.ZeroOrMore

Returns: Regex

Returns a regex that recognizes zero or more strings that are recognized by the given regex.

Returns: Regex

Static members

Static member Description

Regex.Any

Full Usage: Regex.Any

Returns: Regex

A regex that recognizes any single character that was not matched by anything else.

Note that it's not the same with "any character". See more at https://teo-tsirpanis.github.io/Farkle/string-regexes.html#The-dot-regex

Returns: Regex

Regex.Choice(regexes)

Full Usage: Regex.Choice(regexes)

Parameters:
Returns: Regex

Returns a regex that recognizes a string that is recognized by either of the given regexes.

This is an optimized edition of Or for many regexes.

regexes : Regex[]
Returns: Regex

Regex.Empty

Full Usage: Regex.Empty

Returns: Regex

A regex that recognizes only the empty string.

Returns: Regex

Regex.FromRegexString(x)

Full Usage: Regex.FromRegexString(x)

Parameters:
    x : string

Returns: Regex

Returns a regex specified by a string. An invalid regex string will make the building process fail. See more at https://teo-tsirpanis.github.io/Farkle/string-regexes.html

x : string
Returns: Regex

Regex.Join(regexes)

Full Usage: Regex.Join(regexes)

Parameters:
Returns: Regex

Concatenates many regexes.

This is an optimized edition of And for many regexes.

regexes : Regex[]
Returns: Regex

Regex.Literal(c)

Full Usage: Regex.Literal(c)

Parameters:
    c : char

Returns: Regex

Returns a regex that only recognizes a single literal character.

c : char
Returns: Regex

Regex.Literal(str)

Full Usage: Regex.Literal(str)

Parameters:
    str : string

Returns: Regex

Returns a regex that only recognizes a literal string.

str : string
Returns: Regex

Regex.NotOneOf(xs)

Full Usage: Regex.NotOneOf(xs)

Parameters:
    xs : char seq

Returns: Regex

Returns a regex that recognizes any character, except of these on the given sequence. An empty sequence is equivalent to `Regex.Any`.

xs : char seq
Returns: Regex

Regex.OneOf(xs)

Full Usage: Regex.OneOf(xs)

Parameters:
    xs : char seq

Returns: Regex

Returns a regex that recognizes only one character of these on the given sequence of characters.

xs : char seq
Returns: Regex