const regex = /(?!((">)([A-Za-z]|[ء-ي])))=(?=([A-Za-z]|[ء-ي]|\(|\)))/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(?!((">)([A-Za-z]|[ء-ي])))=(?=([A-Za-z]|[ء-ي]|\\(|\\)))', 'gm')
const str = `<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><A HREF="https://translate.google.com/details?sl=en&tl=ar&text=groundwork&op=translate" ADD_DATE="1666511420" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAI5SURBVDiNfZJPSFRRFMZ/9743L+efiZrTkE6UhgVNmwaiP0aLaBNEtSgIikDdtGrVKmggaldLIWlZUKs2kVAbUYKIcFEYmRIohKakzpijznv3nhbzJ2eCuXDgci/fOd/3nU9dfbz61GinXwQsgIAAIhA2K6df3EmN0+DoQDn9oEFpVF1tmKaBRmAALZQn1k0XQFx1LZud9Bo1cKVyk/8/lY64rYcjn6empqc9z7Wu64q1YIxFa5FCIXjpVoC74tDf59MehfkcPHobIhCYWY32nin+7o1GIziORkQIhRxEhHjcuehWKA/0+bz54jAxp4k3QWBL77O5CMv5BTyvQDwWQSlV64Et6+1oFibmNGcPWe6e93l4yQfAiOLbUoTiVpF7w88REURKtEWEqoTFvOLoXsu7r5rcBpzssVVjx2csqwsTHOzq5NnIKMtr63Ql2rlwKvPPxCdjIQb7fG6cMCzlFUOjTnUrayTZGW8j3ZPgx8950t0pjhzYh7UWt8yGhRzcfx2q2YiUafqi2FSdjLz/QLjJ43i6F9/3cRwHLVIyi20l28AVGd9zLWwVA1AKYwzWWoIgqA2SALZskt0GFmA238y5YxnS3SlejX3EGFuSEGxuDWnPu1WfJxFQCpTSiIDB5VexlUyqmZZYBBELONQute5ks58i45OL6wCxmMPtmwmSiTBKgdYapRS6cYNMYf8edza8QzN4pY321lA1A5UcNGwAkNxtH1y/3Eyyw0HEIlLSboxhaeXP8F9VPRfd8eYTcAAAAABJRU5ErkJggg==">underlag/groundwork/foundation/العمل التحضيري/الأساس/</A>
<DT><H3 ADD_DATE="1727566144" LAST_MODIFIED="1727566144">produksjonsunderlag=production basis=()(أساس الإنتاج )</H3>
</DL><p>
<DT><H3 ADD_DATE="1727566144" LAST_MODIFIED="1727566144">antitrust==(مكافحة الاحتكار)</H3>
<DL><p>
(?!(">([A-Za-z]|[ء-ي])))=(?=([A-Za-z]|[ء-ي]))
x(?=y) x followed by y
x(?!y) x NOT followed by y
=(?!(">([A-Za-z]|[ء-ي])))
(?:((">)(?=([A-Za-z])))
=((?=([A-Za-z]|[ء-ي]))(?!y))
(?!(">([A-Za-z]|[ء-ي])))(=)(?=([A-Za-z]|[ء-ي]))
(?!((">)([A-Za-z]|[ء-ي])))(=)(?:([A-Za-z]|[ء-ي]){1})`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions