R
R
Ramir12020-01-19 20:08:09
Regular Expressions
Ramir1, 2020-01-19 20:08:09

Regex: can contain the specified characters, but must contain a letter - how?

Folks, please help me compose a regular expression:
1) the string starts with a letter or number
2) it can contain a-z0-9_.
3) must contain at least 1 letter az
This expression: (^([a-z0-9]){1}[a-z0-9_.?]+)$
includes a string of numbers only, which contradicts condition 3.
https: //regex101.com/r/FylFY1/469

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xD34F, 2020-01-19
@Ramir1

^(?=.*[a-z])[\da-z][\w.]+$

R
Rsa97, 2020-01-19
@Rsa97

^(?:[0-9][a-z0-9_.]*)?[a-z][a-z0-9_.]*$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question