-
Notifications
You must be signed in to change notification settings - Fork 357
Could you support incasesensitive pattern matching? #352
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
Comments
I think you're out of luck; according to the Json Schema specification, That said, there is certainly nothing stopping you from extending class MyStringConstraint extends StringConstraint
{
/**
* {@inheritDoc}
*/
public function check($element, $schema = null, JsonPointer $path = null, $i = null)
{
// Verify a regex pattern
if (isset($schema->pattern) && !preg_match('#' . str_replace('#', '\\#', $schema->pattern) . '#ui', $element)) {
$this->addError($path, "Does not match the regex pattern " . $schema->pattern, 'pattern', array(
'pattern' => $schema->pattern,
));
}
else {
parent::check($element, $schema, $path, $i);
}
} Admittedly that's probably more duplicated code than needs to happen; it might be nice if the base Hope that helps (sorry for the long delay). |
@markomanninen in an attempt to cleanup this repo we are trying to filter the issues and see which ones might be closed. Is it safe to assume this is a rather old issue, which sadly was left unanswered, and can be closed? Feel free to close it yourself with some comments if helpful. |
Schema:
would use -i modifier on preg_match and match with Alan, ALAN, aLaN, etc.
markomanninen@d1011e3#diff-9129e81a8f8053dcd8747c5b88dbaef4
The text was updated successfully, but these errors were encountered: