I am successfully chaining two negative regex (C#/.NET) lookaheads to exclude <html>
tags that contain ' amp' or ' ⚡':
<\s*?html((?!.*?\samp[\s>])(?!.*?\s⚡[\s>]).*?)>
But I was searching for a possibility to OR combine the two searches, something like [amp|⚡]
:
<\s*?html((?!.*?\s[⚡|amp][\s>]).*?)>
Is that possible, and if so, what would be the correct syntax?
EDIT: I had an error in the initial question, because it didn't show quite what I wanted to capture: everything after html up to >, if it doesn't include amp or ⚡. Now the statements are right and also the regEx101. And a good solution has also been commented, that is to use () instead of []. So my current working solution is:
<\s*?html(
(?!
.*?
\s(⚡|amp)[\s>]
)
.*?)>