Tomohiro Matsui wrote a patch to support lookaround assertions in regexps some time ago (http://emacs.1067599.n8.nabble.com/Patch-for-lookaround-assertion-in-regexp-td121057.html#a23863009), but it never got merged.
Is there still interest in something like this? If so I can try updating the patch and submitting. -- Sent with https://mailfence.com Secure and private email