GithubHelp home page GithubHelp logo

Inconsistent Form::PATTERN about forms HOT 12 CLOSED

nette avatar nette commented on June 24, 2024
Inconsistent Form::PATTERN

from forms.

Comments (12)

dg avatar dg commented on June 24, 2024

Probably you can change (...) to (?:...) as fix.

from forms.

MartinSadovy avatar MartinSadovy commented on June 24, 2024

I don't think so. There are missing brackets. Pattern is bracketed only in javascript validator.

PR #105

from forms.

dg avatar dg commented on June 24, 2024

To use (?:....) is not possible?

from forms.

MartinSadovy avatar MartinSadovy commented on June 24, 2024

if you think (?:(.)\1{2,}), answer is no. It is still \2

from forms.

dg avatar dg commented on June 24, 2024

In this case documentation is wrong http://php.net/manual/en/regexp.reference.subpatterns.php

from forms.

dg avatar dg commented on June 24, 2024

@MartinSadovy https://3v4l.org/mlWDo

from forms.

MartinSadovy avatar MartinSadovy commented on June 24, 2024

@dg https://3v4l.org/3BUJe

from forms.

dg avatar dg commented on June 24, 2024

Sorry I don't understand what you mean.

Just here put return (bool) Strings::match($control->getValue(), "\x01^(?:$pattern)\\z\x01u"); and here put return typeof arg === 'string' ? (new RegExp('^(?:' + arg + ')$')).test(val) : null;.

before I create PR, I would like to know, why pattern is bracked.

Because /^abc|def$/ is a different from /^(abc|def)$/.

from forms.

MartinSadovy avatar MartinSadovy commented on June 24, 2024

Oh, I see. I had understood that I use ?: in pattern (eg. in ->addRule). I did not note (only one pair of breckets), my fault, sorry. O:-)

yeah, now it works correctly.

from forms.

dg avatar dg commented on June 24, 2024

👍

btw commit message should be changed, isn't it?

from forms.

MartinSadovy avatar MartinSadovy commented on June 24, 2024

Validator: pattern: supports back reference to Validator: fix different behaviour client and server side while use back reference, is not too long, or actual is ok?

from forms.

dg avatar dg commented on June 24, 2024

Thanks!

from forms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.