I constructed a pattern that is anchored at the start (^) and end ($) and uses a non‐capturing group (?: … ) to alternate between each exact literal target. For every target string I literally match every character and escape only the characters that are regex metacharacters (like . + ( ) { } ^ $ \ etc.). For example, the email “john.doe+shopping@example.co.uk” becomes “john\.doe\+shopping@example\.co\.uk” and the regex string “/^\d{3}-\d{2}-\d{4}$/” becomes "/\^\\d\{3\}-\\d\{2\}-\\d\{4\}\$/" so that the literal “\d”, curly braces, caret, dollar sign, and slashes are matched. I also used a negative lookbehind and lookahead for the special case of "not123" so that it is not preceded by "is-" and not followed by "-valid". The final pattern below is a single alternation (with pipes between alternatives) that matches exactly the 20 given target items and nothing else.