A
A
Anton89892021-09-02 10:04:04
Regular Expressions
Anton8989, 2021-09-02 10:04:04

How to expand a regular expression with special characters?

Good afternoon) There is a regular expression, /^(?=.*\d)(?=.*[az])(?=.*[AZ])[0-9a-zA-Z]{8,}$/ I can't figure out how to expand it so that you can also enter all the special characters "?", ":", "." etc. Thanks in advance))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-09-02
@Anton8989

[0-9a-zA-Z]add here all the characters that need to be allowed "?", ":", "." etc.

/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z?:.]{8,}$/

(?=.*[?:.])if you want to make it mandatory to enter at least one of the characters "?", ":", ".".
/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[?:.])[0-9a-zA-Z?:.]{8,}$/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question