question: @Matches acting weird
See original GitHub issueHi there,
I think it is a bug, but I might be doing something wrong.
Description
See the following class:
class Example {
@Matches(/^[0-9]{2}\/[0-9]{4}$/g) // MM/YYYY format
@IsOptional()
from?: string;
@Matches(/^[0-9]{2}\/[0-9]{4}$/g) // MM/YYYY format
@IsOptional()
to?: string;
}
When I am only populating either of the fields, it works as expected.
const a = new Example();
a.from = "05/2017";
validate(a); // gives no error
But when I am populating both fields, it gives me an error:
const a = new Example();
a.from = "05/2017";
a.to = "05/2020";
validate(a); // gives an error
from must match
/^[0-9]{2}\\/[0-9]{4}$/g
regular expression
There is an extra \
in the error message, it might have something to do with.
Environment
- nodejs: 12
- browser
- framework/library
class-validator version: 0.11.1
If someone could have a look it would be appreciated. Cheers
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
15 Improv Games, Exercises & Activities for Adults in 2022
Improv games are acting exercises that require participants to react in real time ... Questions Only is an easy improv game for beginners....
Read more >Awkward Question-and-Answer Game - YouTube
Awkward Question -and-Answer Game. Did you know that playing a "get to know you" game with your co-workers will build team morale?
Read more >50 Get to Know You Games and Icebreakers - SignUpGenius
Start the conversation and get your group moving, talking and laughing with these icebreaker games and ideas that are guaranteed to build relationships...
Read more >22 great improv games for better collaboration (and fun!)
Improv has its roots in schools of acting and comedy, and has often been used to warm-up actors and to build collaborative skills....
Read more >Acting Games | Drama Exercises and Games for Kids and Adults
They help students get comfortable, warmed up and focused. Acting games also develop important skills required for acting and performing.
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 Free
Top 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
@vlapo Thanks again for taking a look.
I don’t think either. I don’t need
g
actually. I never came across this before, so I really appreciate your efforts.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.