-1

Does this regular expression mean that at least one of the following that isn't a-z:

(?=.*(?:[a-z]))

It's part of the following expression:

/^(?=[A-Za-z0-9\'\s\d\.]{2,50}$)(?=.*(?:[a-z]))[a-zA-Z0-9]+[A-Za-z0-9\'\s\.]+$/m
Avinash Raj
  • 166,785
  • 24
  • 204
  • 249
somejkuser
  • 8,656
  • 19
  • 58
  • 122

1 Answers1

0

No, (?=.*(?:[a-z])) means that there could be whatever but must finish with a lowercase letter.

This regex means:

/^(?=[A-Za-z0-9\'\s\d\.]{2,50}$)(?=.*(?:[a-z]))[a-zA-Z0-9]+[A-Za-z0-9\'\s\.]+$/m

Match the line that starts with 2 to 50 alphanumeric, single quote, spaces or a dot, and then follows with lower case letter, and continues with alphanumerics and must ends followed by alphanumerics, spaces, single quote or dot.

Here you can see a better graphical approach for your regex:

Regular expression visualization

Actually, this can be improved as:

/^(?=[A-Za-z\d'\s.]{2,50}$)(?=.*[a-z])[a-zA-Z\d]+[A-Za-z\d'\s.]+$/m

Regular expression visualization

Federico Piazza
  • 28,830
  • 12
  • 78
  • 116