English 中文(简体)
错误: 在@vee- validate/ rules 中使用 Regex 时, 不存在这样的验证器 regex 。
原标题:Error: No such validator regex exists. while using regex in @vee-validate/rules
I`m using "@vee-validate/rules": "^4.9.6", "vee-validate": "^4.9.6", "vue": "^3.2.37" for validating fields in my app. I need to write a regular expression to regulate the car number in my country. I tried to do it according to the documentation (https://vee-validate.logaretm.com/v4/guide/global-validators#regex) but I got the following error: Uncaught (in promise) Error: No such validator regex exists. at _test (vee-validate.js?v=a46838b9:751:11) at _validate (vee-validate.js?v=a46838b9:683:26) at validate (vee-validate.js?v=a46838b9:636:24) at validateCurrentValue (vee-validate.js?v=a46838b9:1402:14) at meta.valid (vee-validate.js?v=a46838b9:1425:12) at runLatest (vee-validate.js?v=a46838b9:421:21) at vee-validate.js?v=a46838b9:1445:7 at chunk-ZV5R4Z6I.js?v=32b264a4:4011:154 at callWithErrorHandling (chunk-ZV5R4Z6I.js?v=32b264a4:1553:18) at callWithAsyncErrorHandling (chunk-ZV5R4Z6I.js?v=32b264a4:1561:17) at hook.__weh.hook.__weh (chunk-ZV5R4Z6I.js?v=32b264a4:3993:19) at flushPostFlushCbs (chunk-ZV5R4Z6I.js?v=32b264a4:1719:41) at render2 (chunk-ZV5R4Z6I.js?v=32b264a4:7574:5) at mount (chunk-ZV5R4Z6I.js?v=32b264a4:5114:13) at app.mount (chunk-ZV5R4Z6I.js?v=32b264a4:10315:19) at main.js:28:5 What can be the problem?
问题回答
The issue has been mentioned on their official github issue thread. In order to solve this you have to first import the scripts. import { required, regex } from vee-validate/dist/rules ; extend( regex , regex);




相关问题
Uncommon regular expressions [closed]

Recently I discovered two amazing regular expression features: ?: and ?!. I was curious of other neat regex features. So maybe you would like to share some tricky regular expressions.

regex to trap img tag, both versions

I need to remove image tags from text, so both versions of the tag: <img src="" ... ></img> <img src="" ... />

C++, Boost regex, replace value function of matched value?

Specifically, I have an array of strings called val, and want to replace all instances of "%{n}%" in the input with val[n]. More generally, I want the replace value to be a function of the match ...

PowerShell -match operator and multiple groups

I have the following log entry that I am processing in PowerShell I m trying to extract all the activity names and durations using the -match operator but I am only getting one match group back. I m ...

Is it possible to negate a regular expression search?

I m building a lexical analysis engine in c#. For the most part it is done and works quite well. One of the features of my lexer is that it allows any user to input their own regular expressions. This ...

regex for four-digit numbers (or "default")

I need a regex for four-digit numbers separated by comma ("default" can also be a value). Examples: 6755 3452,8767,9865,8766,3454 7678,9876 1234,9867,6876,9865 default Note: "default" ...

热门标签