I wrote regex to catch specific links in the text
/(?<!<a href=")b(?:(?:(?<proto>https?|ftp):)?//)?(?:(?<user_pass>[w._~%!$&'()*+,;:=-]+)@)?(?<host>(?:(?=[a-zA-Z0-9-]{1,63}.)(?:xn--)?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*.)+(?<tld>[a-z]{2,63}))(?::(?<port>d{1,5}))?(?<path>(?:/[a-zA-Z0-9-._~%!$&'()*+,;=:@]+)*/?)(?<query>?[a-zA-Z0-9-._~%!$&'()*+,;=:@/?]*)?(?<fragment>#[a-z0-9-._~%!$&'()*+,;=:@/?]*)?b(?!</a>)/g
https://regex101.com/r/ntyx3K/1
the problem is that I’m clinging values from the tags <figure>, <img>, <picture>, <trix-attachment>
regex issue
so how can i update this regex to avoid values in <figure>, <img>, <picture>, <trix-attachment>
in the text like this https://regex101.com/r/9tMKYI/1 ?