Matches does not work
See original GitHub issueError CS1929
'IRuleBuilderOptions<MyModel, int>' does not contain a definition for 'Matches' and the best extension method overload 'DefaultValidatorExtensions.Matches<MyModel>(IRuleBuilder<MyModel, string>, string)' requires a receiver of type 'IRuleBuilder<MyModel, string>'
Code:
RuleFor(r => r.ProductType).Matches(@“^[0-9]*$”);
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
java - Regex doesn't work in String.matches()
Welcome to Java's misnamed .matches() method... It tries and matches ALL the input. Unfortunately, other languages have followed suit :(.
Read more >Why isn't the Java matches method working? (Java pattern ...
There are actually two possible solutions to this problem: Modify your regex pattern to match the entire String, and keep using the matches...
Read more >Matcher.matches() is not working as expected
I am trying to match DateTime input using the Pattern and Matcher class of Apex but wasn't able to achieve it. I've created...
Read more >Not working in UIPath Matches - Activities
Below is my test inside the Matches activity, but when in the actual run, it cannot find any match while still using the...
Read more >apex - patern and matcher not working
You have to call myMatcher.find() . Calling matches just tells you if the expression matches the whole input. Also note that you need...
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
That’ll be why. Matches can only be used with string properties…internally it uses the standard .net Regex. You can’t use this on non-string properties.
That makes sense, thanks.