Answer the question
In order to leave comments, you need to log in
A regular expression that checks for the presence of a tag in a string and the presence of a specific link in that tag?
Hello.
We need a regular expression that will check for the presence of the <a> tag and its link in the text.
For example:
<а href="https://kto-tut.ru/files/5767.mp3" class="sm2_button">5767.mp3</а> - можно проверять по самому тэгу,
и смотреть уже внутри него href и если в href есть /files/ и .mp3, то вернуть true.
<а href="https://kto-tut.ru/files/sdfg235.mp3" class="sm2_button">5767.mp3</а> - true
<а href="https://kto-tut.ru/photo/14.jpg" class="sm2_button">13.jpg</а> - false
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question