I'd like to removing everything that is is brackets () if (and only if) they are at the end and not do match the following pattern \(\d{4}\p{Pd}\d{4}\) *. This pattern is nothing more than date range in brackets, eg. (1920-2988).
For instance, I'd like to match/capture (for removing, ie. string.replaceAll(my_regex_here, "")):

foo bar (blah)

foo bar (blah) blah (blah)


I don't like to match:

some (blah) data
some date following (1920-1921).

I have the following regex: \s*(.+?)\s*$. It tends to match too much:

some data (..) match (match)
some data (1920-1977)


Remove everything in brackets at the end
Use negative look ahead to avoid date ranges, then actually match it using [^()]+?:
\s*\(                  # Match 0+ spaces, a '(',
(?!\d{4}\p{Pd}\d{4}\)) # which is not followed by a date range and a ')',
[^()]+                 # 1+ non-parenthesis characters and
\)\s*$                 # ')' then 0+ spaces right before the end of line.

Try it on regex101.com.
The above regex will not match:
parentheses with no content ()
years with more than 4 digits (1234-56789)
or less than 4 (123-4567)
nested ((brackets))
mismatched (brackets

