Skip to content

Commit

Permalink
Fix merge error
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoepelman authored May 10, 2024
1 parent 655f20c commit d53cc0f
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@ public fun ValidationBuilder<String>.pattern(pattern: String): Constraint<String
/** Enforces the string must be UUID hex format. */
fun ValidationBuilder<String>.uuid() = pattern("^[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}$")


fun ValidationBuilder<String>.pattern(pattern: String) = pattern(pattern.toRegex())


fun ValidationBuilder<String>.pattern(pattern: Regex) = addConstraint(
"must match the expected pattern",
pattern.toString()
) { it.matches(pattern) }

public fun ValidationBuilder<String>.pattern(pattern: Regex): Constraint<String> =
addConstraint(
"must match the expected pattern",
Expand Down

0 comments on commit d53cc0f

Please sign in to comment.