I solved the problem by breaking the target items into four distinct groups: (1) dates, (2) product codes, (3) prices, and (4) reference numbers. For the dates, the only valid strings in the text are exactly '2023-12-31', '2024-02-29', '01/15/2024', and '29.02.2024'. Instead of trying a full date‐validation regex (which would be far more complicated and might accidentally match invalid ones), I simply list these four options literally (escaping the separator characters as needed). For the product codes, there are two formats: one starting with a hash (eg, "#A-123-45$") and one enclosed in square brackets (eg, "[B-678-90%]"). I match these by requiring a starting literal (# or [), then an uppercase letter, a hyphen, exactly three digits, another hyphen, exactly two digits, and finally the proper closing character ($ for the hash codes or %] for the bracketed ones). For the prices, there are three literal targets: "$1,234.56", "$99,999.99" and "€1.234,56". I list them as alternatives, escaping the currency symbols, commas, dots, etc. Finally, for the reference numbers, the valid ones all start with <<REF:, then three uppercase letters, a hyphen, and a year of either 2023 or 2024, finishing with >>. I list that pattern as a literal structure with the correct escapes. All four groups are then combined in one alternation and wrapped with ^ and $ anchors so that the regex matches exactly one of the provided 13 target strings and nothing else.