Foreword: I know about the general consensus against using regular expressions to parse HTML. By asking you in advance, avoid any advice in this regard.
explanations.
I have the following regex
/<div class="panel-body">([^]*?)(<\/div>|$)/gi
It matches all content, including self, inside divwith a class.panel-body
Full compliance:
<div class="panel-body">
<a href="#">Link</a>
Line 1
Line 2
Line 3
</div>
.. it also matches content without a closing tag div.
Full compliance:
<div class="panel-body">
<a href="#">Link</a>
Line 1
Line 2
Line 3
Don't match after closing `div`...but match this and below in case closing `div` is removed.
Line below 1
Line below 2
Line below 3
Question.
How can I improve my regex to do the following:
regex101.com
1:
<div class="panel-body">,
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Webmin 1.851 on centos.centos (CentOS Linux 7.3.1611)</title>
</head>
<body>
<div>
<div>
<div class="panel-body">
* : .
2:
. , .