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

Validators::is() doesnt work well with pattern containing pipe character (because of string exploding) #15

Closed
s4muel opened this issue May 30, 2014 · 5 comments

Comments

@s4muel
Copy link

s4muel commented May 30, 2014

i added a PR #14 that covers the pattern e.g.: 'pattern:(John|Carl) Doe'

because of the "foreach (explode('|', $expected) as $item)..." in the is() validator, the validator explodes the string trying to make alternatives of possibilities, but the pipe in the $expected string represents regex alternative. don't know how to solve it generally, so i made just the update to test.

@xantin
Copy link

xantin commented Sep 23, 2014

Hello, yes that's true I have same problem, I already prepare code and created a bit new syntax for that.
What do you think about pattern:~(John|Carl)~? For correct parsing regex need to be in tilda (~).

@Majkl578
Copy link
Contributor

Have a look at #31 as a possible fix.

@xantin
Copy link

xantin commented Sep 24, 2014

Should I send pull request?

@Majkl578
Copy link
Contributor

I did, see #31.

@dg
Copy link
Member

dg commented Apr 1, 2016

This is too hard to fix.

@dg dg closed this as completed Apr 1, 2016
milo pushed a commit to milo/nette-utils that referenced this issue Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants