Reputation: 99
how to convert the following php regex to javascript regex?
php regex:- (?s)(?<=<a).*?(?=<\/a>)
Upvotes: 0
Views: 228
Reputation: 43166
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.
Upvotes: 2