poppinss / indicative

Indicative is a simple yet powerful data validator for Node.js and browsers. It makes it so simple to write async validations on nested set of data.
https://indicative.adonisjs.com/
MIT License
417 stars 52 forks source link

Ignoring Regex to not allowing one of multiple spaces #265

Open antonioOrtiz opened 3 years ago

antonioOrtiz commented 3 years ago

Package version

"indicative": "^7.4.4",

Node.js and npm version

v14.16.0,  6.14.11

Sample Code (to reproduce the issue)

validations.regex([new RegExp('^([a-zA-Z0-9_])+$')]), 
validations.regex([new RegExp('^\\S+$')])

So in my textarea which I'm validating, this will fire a error

"Foo Bar".  /* entering a string with a space

But this:

"    "    /* just four spaces */

I want no spaces allowed one or more, Or a better to say this if a user entered just spaces it would fail!

Doesn't validate! Please help!