I have this HTML
<br />
<strong>Name:</strong> Josef
<br />
And I want to match the name, “Josef” in this case.
I have some problems as Josef is the last word of that string if you don’t use m with regex.
My approach
^<strong>Name:</strong> (.*?)$
doesn’t seem to work, how is this done correctly?
If your HTML string has two literal linebreaks in it like as it seems to, you’ll need to set your regex to multiline mode so that
$matchesend-of-lineas well asend-of-string.