K
K
Kirill Zhilyaev2016-01-21 21:05:24
PHP
Kirill Zhilyaev, 2016-01-21 21:05:24

Regular season. How to find all links in a text?

Help me write a regular expression that will parse links from text.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-01-22
@kirill_782

<a\s.*?href="(.+?)".*?>(.+?)</a>
The first variable will contain the URL link, the second will contain all the text between the opening and closing tags

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question