indicative
indicative copied to clipboard
Regex vaidation expect to end with $
Package version
7.2.1
Node.js and npm version
Node: v12.4.0 npm: 6.13.7
Sample Code (to reproduce the issue)
Following code works:
const rules = {
username: [
validations.required(),
validations.regex(["^[a-zA-Z0-9._-]+$"])
]
};
Following code does NOT work:
const rules = {
username: [
validations.required(),
validations.regex(["^[a-zA-Z0-9._-]+"])
]
};
https://indicative.adonisjs.com/validations/master/regex The regex expects to end with $, otherwise it doesn't work
Can you share the inputs against which the regex are tested along with the expected behavior and the actual behavior
Kindly check the code i shared https://codesandbox.io/s/laughing-snow-py2h8?file=/src/index.js
There are two examples, example 1 works, example 2 does not work as expected.
@thetutlage Did you get a chance to look into the code samples?
Thanks