Fixed an issue with the way the regex pattern was generated for the SecureValidationRule type in the library target.

This commit is contained in:
2025-10-12 19:15:26 +02:00
parent a47a3a464b
commit c2ab60a5aa
2 changed files with 146 additions and 14 deletions
@@ -81,7 +81,7 @@ private extension SecureValidationRule {
/// - Parameter input: An input to validate.
/// - Returns: A flag that indicates whether a given input is valid or not.
func isValid(_ input: String) -> Bool {
let regexPattern: String = .init(format: .Pattern.securityInput, inputType.rawValue)
let regexPattern = String(format: .Pattern.securityInput, inputType.rawValue)
do {
if #available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 6.0, *) {
@@ -131,5 +131,5 @@ private extension SecureValidationRule {
private extension String.Pattern {
/// A regular expression pattern to match the security inputs against.
static let securityInput = "^([a-z]|[A-Z]){%@}$"
static let securityInput = "^([a-z]|[A-Z]){%d}$"
}