How to apply Regex validation to an array of strings
See original GitHub issueBelow is the code test the bug
var EmailSchema = new SimpleSchema({
emails: {
type: [String],
minCount: 1,
optional: false,
regEx: SimpleSchema.RegEx.Email
}
});
isValid = EmailSchema.namedContext("myContext").validate({ emails: ['sdfsdfsf sd'] });
//isValid is false.
isValid = EmailSchema.namedContext("myContext").validateOne({ emails: ['sdfsdfsf sd'] },"emails");
//isValid is true. I could be wrong but shouldn't "emails" validation be false?
I’m probably missing something but is it possible to apply Regex validation to an array of strings as defined above?
Issue Analytics
- State:
- Created 8 years ago
- Comments:8
Top Results From Across the Web
what is javascript regex to validate an array of string value
I want to validate an array of a single element of type string using regex. The array should not be empty and should...
Read more >How to apply Regex validation to an array of strings #304
var EmailSchema = new SimpleSchema({ emails: { type: [String], minCount: 1, optional: false, regEx: SimpleSchema.RegEx.
Read more >How to apply regular expression on array of Strings(String[])
I am getting these in string[] ( String Array) parameter. In next action I need to display only below as a User Input...
Read more >Regular Expression for array of numbers - Regex Tester
Match anything enclosed by square brackets. Find Substring within a string that begins and ends with paranthesis · Simple date dd/mm/yyyy · Blocking...
Read more >Guide to Regular Expressions and Matching Strings in ...
In this guide, we'll take a look at the RegExp class and Regular ... In order to achieve this, you can pass an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use a full definition instead of the
[String]
shortcut.Sounds good. Thanks.
On Sat, Mar 28, 2015, 7:50 AM Eric Dobbertin notifications@github.com wrote: