how to convert the following php regex to javascript regex?
php regex:- (?s)(?<=<a).*?(?=<\/a>)
It's not possible to use the exact same pattern in javascript, because lookbehinds aren't supported.
The best I could do is
<a([^]*?)(?=<\/a>)
It should match the same text as the php regex, but captures the text in the first capture group instead.
[^]*? <-- I think this is a typo? Should probably say something like [^<]*? but then it would fail on <a href="#yo"><b>click me</b></a>. Stick with .*? or, you know, don't use regexes to parse HTML to begin with ;)[^] is intended. It's perfectly valid regex meaning "match absolutely any character, even newline".
href="something"part of a link?