JADE Environment Development Ideas

What's new in the upcoming JADE release?

IMPROVED DEVELOPER EFFICIENCY. ENHANCED SECURITY. SMOOTHER INTEGRATION

The JADE 2022 release meets tomorrow’s business demands.


Start your update to JADE's latest release

Email validation method on String primitive

I would say every Jade system out there has an email validation method on the String primitive. Could we have one created by Jade on the String primitive on the root schema? String :: isValidEmailAddress__

  • Sam Stokell
  • Jul 6 2020
  • Closed
  • Attach files
  • C Bingham commented
    August 10, 2022 03:27

    You can implement this easily enough yourself using JadeRegex. A reasonable regex to use is the one specified by HTML5 for email input validation:


    ^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$


    https://html.spec.whatwg.org/multipage/input.html#email-state-(type=email)


    It's not RFC 5322 compliant (eg. it doesn't handle comments and quoted strings which are technically valid in an email address but not really used in practice) but it was deemed good enough by Google/Microsoft/Apple/Mozilla.

  • Steve Knyn commented
    July 14, 2020 07:00

    At least if Jade provide a standard it should cover the generic needs of most requirements and then developers could inherit this to their own requirements to add any further tweaks

    stevek

  • Ty Baen-Price commented
    July 06, 2020 01:00

    I would suggest that every JADE system out there has a different email validation method, as while there is a standard, it is virtually impossible to implement, and everyone does it differently, and according to their own needs. Incidentally, gmail and outlook do not fully implement the standard.

    Once Regex comes out, you'll be able to implement one of your own, to your own needs, much more cleanly and easily.

    Also, is it a productive use of our time to supply code everyone already has?