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

Type members

Classlikes

object Blank

Attributes

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.

Type parameters

V

the string to compare with the end of the input.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object EndWith

Attributes

Companion
class
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.

Type parameters

V

the pattern to match against the input.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Match

Attributes

Companion
class
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.

Type parameters

V

the string to compare with the start of the input.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object StartWith

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
StartWith.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 SemanticVersion = Match["^v?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"]

Tests if the input is a valid semantic version as defined in semver site.

Tests if the input is a valid semantic version as defined in semver site.

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