Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joi.string().regex() with support for all modifiers #1429

Closed
matuszeman opened this issue Feb 9, 2018 · 1 comment
Closed

Joi.string().regex() with support for all modifiers #1429

matuszeman opened this issue Feb 9, 2018 · 1 comment
Assignees
Labels
breaking changes Change that can breaking existing code feature New functionality or improvement
Milestone

Comments

@matuszeman
Copy link

Context

  • joi version: <=13.1.2

What are you trying to achieve or the steps to reproduce ?

Have available all possible regex modifier - e.g. global, multiline, ... currently all are ignored except 'i'.
https://github.com/hapijs/joi/blob/master/lib/types/string/index.js#L119

Example

The schema below (if I got it right) should match base64 encoded string with fixed line-length also - multiline modifier is used.

const schema = Joi.string().regex(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/m;)
@Marsup Marsup self-assigned this Aug 3, 2018
@Marsup Marsup added request breaking changes Change that can breaking existing code labels Aug 3, 2018
@Marsup Marsup added this to the 14.0.0 milestone Aug 3, 2018
@Marsup
Copy link
Collaborator

Marsup commented Aug 3, 2018

I disagree on the global flag for the index problem but agreed this should have been allowed a long time ago. No ETA on v14 yet.

@Marsup Marsup closed this as completed in 96d02a3 Oct 14, 2018
@hueniverse hueniverse added feature New functionality or improvement and removed request labels Sep 19, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking changes Change that can breaking existing code feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

3 participants