Search code examples
javascriptregexzurb-foundationabide

Foundation Abide matching line breaks


I am trying to use foundation abide to make error when my form is submitted. I cannot grasp how to allow any character to pass (limited 2000) and allow line breaks:

My code

trainerDescription : /^.{0,1999}$/,

Solution

  • Since javascript won't support (?s) dotall modifier, you could use [\s\S] regex to match any space or non-space character. Note that \s would match any kind of whitespaces (vertical or horizontal).

    /^[\s\S]{0,1999}$/m