Regular Expressions 101

Community Library

Community Library Entry

1

Regular ExpressionOpen Workspace

/
<a [^>]+>(?:(?!<\/a>).)+<\/a>
/
gm

Description
Created·2024-07-10 11:21
Type·Match
Flavor·PCRE2 (PHP)

Extract all links from HTML including the tag itself and its contents. The content may include other tags, such as H1, img, etc.

Извлечь все ссылки из HTML включая сам тег и его содержимое. Содержимое может включать другие теги, например, H1, img и т.д.

Submitted by a.panarin
Open Workspace