Giter VIP home page Giter VIP logo

Comments (7)

cferdinandi avatar cferdinandi commented on May 26, 2024

I'm so sorry, but it's no clear to me what you're trying to say. Have you tested it? The demo page uses on-page patterns and it works as-is.

from bouncer.

robsonsobral avatar robsonsobral commented on May 26, 2024

I'm sorry, mister. My bad.

I think, despite you have give up on using the native API, the validation has to be the same.

From the specification:

[...] the regular expression language used for this attribute is the same as that used in JavaScript, except that the pattern attribute is matched against the entire value, not just any subset (somewhat as if it implied a ^(?: at the start of the pattern and a )$ at the end).

Which makes the ^ and $ on some demo samples unnecessary and allows some pattern mismatches. For example, your demo of the telephone number, matches 123-456-7890, but also 00000000000000123-456-7890, ABCD123-456-7890 or 123-456-7890-this RegEx's start isn't anchored to the start of the string neither its end is anchored to the end of the string.

There's still the case of the multiple attribute, which requires the RegEx to be tested on each value and the RegEx flag:

[..] compiled as a JavaScript regular expression with only the "u" flag specified [...]

I can submit a pull request, if you want to.

from bouncer.

cferdinandi avatar cferdinandi commented on May 26, 2024

Ah yes, I see what you mean. I... I suck at regex!

Yes, a pull request would be AWESOME, thank you!

from bouncer.

robsonsobral avatar robsonsobral commented on May 26, 2024

@cferdinandi , may I add the lock and changelog files?

from bouncer.

cferdinandi avatar cferdinandi commented on May 26, 2024

No thanks. I use tags for changelog.

from bouncer.

robsonsobral avatar robsonsobral commented on May 26, 2024

Wow, I wasn't talking about the release, but something to help others of analyze the changes in the future. It can be useful.


Pull request submitted!

from bouncer.

cferdinandi avatar cferdinandi commented on May 26, 2024

Fixed with v1.0.3. thanks for this, @robsonsobral !

from bouncer.

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.