Regex vaildater
See original GitHub issueIs your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I’m always frustrated when […] About @marblejs/middleware-io, I want validate with regex
Now, I validate which using requestValidator (type), But I have to validate with other pipe function (regexp)
Describe the solution you’d like A clear and concise description of what you want to happen. Add option to validate body parameter with regex
Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered.
import { requestValidator$, t } from '@marblejs/middleware-io'
const registerVaildater$ = requestValidator$({
body: t.type({
email: t.regex(new Regexp(something)),
name: t.regex(new Regexp(something)),
password: t.regex(new Regexp(something)),
rPassword: t.regex(new Regexp(something))
})
});
Additional context Add any other context or screenshots about the feature request here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
regex101: build, test, and debug regex
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
Read more >RegExr: Learn, Build, & Test RegEx
Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference, and searchable community patterns.
Read more >Regex Tester and Debugger Online - Javascript, PCRE, PHP
Regular Expression Tester with highlighting for Javascript and PCRE. Quickly test and debug your regex.
Read more >Free Online Regular Expression Tester - FreeFormatter.com
This free regular expression tester lets you test your regular expressions against any entry of your choice and clearly highlights all matches.
Read more >Debuggex: Online visual regex tester. JavaScript, Python, and ...
Test your regex by visualizing it with a live editor. JavaScript, Python, and PCRE.
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
As stated in the docs for
middleware-io
, the middleware is based onio-ts
library. You can use https://gcanti.github.io/io-ts-types/modules/regexp.ts.html fromio-ts-types
which should allow you to do something like:Closing this issue because it is not related to
@marblejs/middleware-io
package.