Code Monkey home page Code Monkey logo

Comments (7)

JoostK avatar JoostK commented on May 8, 2024

The pattern /^[^+%{}~?^:#!|=*;,[]<>"'\¿\-]*$/ contains a closing ] within the negated character set, causing the set to be closed prematurely.

I don't know how this used to work before, but the current behavior is expected. There is no security implications to this, as frontend data validation should never be considered sufficient to guard data validity.

from angular.

pawangit-hub avatar pawangit-hub commented on May 8, 2024

Regular expression is absolutely working fine on JAVA and other online forums like https://regexr.com/ Only, in Angular 14.2.0 its not working, that means Regular expression has no problem.
For your information @JoostK , regular expression /^[^+%{}~?^:#!|=*;,\[\]<>"'`\¿\-]*$/ is absolutely working fine on Angular 10.2.0. That means, it may be a bug in 14.2.0.

Kindly share your inputs on this.

from angular.

JoostK avatar JoostK commented on May 8, 2024

regexr.com has the same behavior as I mentioned:

image

but, when pasting the regex, it will automatically escape the closing ]:

image

Doing so fixes the problem, which is actually the way to go here.

from angular.

pawangit-hub avatar pawangit-hub commented on May 8, 2024

You can check the regular expression mentioned in the query:
/^[^+%{}~?^:#!|=*;,\[\]<>"'`\¿\-]*$/
This expression is working fine on https://regexr.com/ and Angular 10.2.0 while the same is not working on Angular 14.2.0. You can check by pasting this expression on regexr.com and it will not escape any character.

from angular.

ShivGuitHub avatar ShivGuitHub commented on May 8, 2024

@JoostK , yes when I pasted the regular expression /^[^+%{}~?^:#!|=*;,\[\]<>"'`\¿\-]*$/ over the https://regexr.com/, it has not skipped not a single character and accepting all the letters x, f, or b.

from angular.

JeanMeche avatar JeanMeche commented on May 8, 2024

/^[^+%{}~?^:#!|=*;,\[\]<>"'`\¿\-]*$/ is not the regex you shared initially.

It has [] escaped => \[\], this is what happens when pasting it to regexr.com.

from angular.

ShivGuitHub avatar ShivGuitHub commented on May 8, 2024

@JoostK , your input will be required to give this thread a clear direction. Look at the regular expression in the question subject, /^[^+%{}~?^:#!|=*;,\[\]<>"'`\¿\-]*$/. Here, user is asking why it is not allowing x,f, and b characters on Angular 14.2.0 while the same is working on Angular 10.2.0 . I have validated and regular expression is correct and working fine on other language like Java, and it is working fine. It seems, problem relates somewhere from Angular Validators framework.

Can you get validate it? This can be bug in the mention version. Because I checked the regular expression online and it is working as expected.

from angular.

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.