canceraiddev / elm-form-builder / Form.Lib.RegexValidation

Helper functions for Regex Validation

Time

decoder : Json.Decode.Decoder RegexValidation


type alias RegexValidation =
{ pattern : Regex
, message : String 
}

forbidSuffixRegex : String -> Maybe Regex

Constructs a Regex that forbids a string from having the provided suffixes. Avoids lookarounds to ensure compatibility with WebKit-based browsers.

fromSuffixConstraints : List ( String, String ) -> List RegexValidation