string

io.github.iltotore.iron.constraint.string$
object string

String-related constraints.

Attributes

See also:

collection

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
string.type

Members list

Concise view

Type members

Classlikes

object Blank

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Blank.type
final class EndWith[V <: String]

Tests if the input ends with the given suffix.

Tests if the input ends with the given suffix.

Attributes

V

the string to compare with the end of the input.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object EndWith

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
EndWith.type
final class Match[V <: String]

Tests if the input matches the given regex.

Tests if the input matches the given regex.

Attributes

V

the pattern to match against the input.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Match

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Match.type
final class StartWith[V <: String]

Tests if the input starts with the given prefix.

Tests if the input starts with the given prefix.

Attributes

V

the string to compare with the start of the input.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object StartWith

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Types

type Alphanumeric = DescribedAs[ForAll[Digit | Letter], "Should be alphanumeric"]

Tests if the input only contains alphanumeric characters.

Tests if the input only contains alphanumeric characters.

Attributes

type Blank = DescribedAs[ForAll[Whitespace], "Should only contain whitespaces"]

Tests if the input only contains whitespaces.

Tests if the input only contains whitespaces.

Attributes

See also:

Whitespace

type LettersLowerCase = DescribedAs[ForAll[Not[Letter] | LowerCase], "All letters should be lower cased"]

Tests if all letters of the input are lower cased.

Tests if all letters of the input are lower cased.

Attributes

type LettersUpperCase = DescribedAs[ForAll[Not[Letter] | UpperCase], "All letters should be upper cased"]

Tests if all letters of the input are upper cased.

Tests if all letters of the input are upper cased.

Attributes

type Trimmed = DescribedAs[Empty | Not[Head[Whitespace] | Last[Whitespace]], "Should not have leading or trailing whitespaces"]

Tests if the input does not have leading or trailing whitespaces.

Tests if the input does not have leading or trailing whitespaces.

Attributes

See also:

Whitespace

type ValidURL = DescribedAs[Match["((\\w+:)+\\/\\/)?(([-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6})|(localhost))(:\\d{1,5})?(\\/|\\/([-a-zA-Z0-9@:%_\\+.~#?&//=]*))?"], "Should be an URL"]

Tests if the input is a valid URL.

Tests if the input is a valid URL.

Attributes

Note:

it only checks if the input fits the URL pattern. Not if the given URL exists/is accessible.

type ValidUUID = DescribedAs[Match["^([0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12})"], "Should be an UUID"]

Tests if the input is a valid UUID.

Tests if the input is a valid UUID.

Attributes