+ 13
I understand the code and changed it a bit to make it even clearer, but I do not have a clear practical application !?
3 Respuestas
+ 7
10th string - there is small 't' letter in the string so it matches, too. (think it wasn't planned)
I can't imagine practical application of single [^A-Z], too. But you can use lots of differen patterns. It might be useful to check if user's unput is correct format. For example checking if the string is email:
^[a-z_.]{4, 18}@[a-z]{2, 13} \.[a-z]{2, 8}$ #nearly like
or correct format of telephone number, like
^(?: 8|+7)(?:705|777|707)[0-7]{7}$
for my country.
+ 3
What do you mean? Are you not sure when you’ll actually use it? I recently used it for web scraping from IMDB
+ 3
Here is an example for a practical application for a regex:
https://code.sololearn.com/cnbUBK5uKvnG/?ref=app