framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.06k stars 3.23k forks source link

Resolved: Input patterns don't work correctly #4095

Closed Simone4e closed 1 year ago

Simone4e commented 1 year ago

Describe the bug

Using the validators with the patterns is not validated correctly, in fact as you can see from the two examples above, the one using Framework7 is not validated correctly instead the one without the framework works perfectly.

To Reproduce

Steps to reproduce the behavior:

  1. Go to all two fiddle
  2. Write password "pppppppP1!"
  3. See error.

Expected behavior

It should validate it correctly

Actual Behavior

It is validated as an error

Find bug but why?

I discovered the bug but I don't know why, in practice the pattern is this ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*(\W|_)).{8,}$ but inspecting it in the code it shows this ^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*(W|_)).{8,}$ it almost seems to escape the pattern (most of \ is missed)

For resolve problem pattern should be : ^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*(\\W|_)).{8,}$