Write and explain a regular expression

Writes one regular expression for your examples of what to match and not match, explains each part, and lists the cases it still gets wrong.

Task: Write one regular expression that matches the lines I want and skips the lines I do not want. Context: I use it in [language or tool] with the regex flavor [flavor, if you know it]. It should match [what to match]. Examples that must match are [examples to match]. Examples that must not match are [examples to skip]. Rules: - Test the expression against every example I gave, one by one, before you answer, and show the result of each. - Prefer a simple, readable expression over a clever one. Split it into parts with a comment on each when it passes 40 characters. - If a feature you use does not exist in every regex flavor, say so and give the fallback for my flavor. - Tell me about input that could make it slow, such as nested repeats on long text. - Use only fake data in the examples you add, and ask for no real personal data or secrets. Result: The expression in one code block, a table of each example with match or no match, then a list of at most 4 parts explained in one line each and at most 3 cases it still gets wrong.

Updated