I want to remove this patterns in the text:
(22.11.2023): ---> it should be removed
(): ---> it should be removed
(22.11.2023) ---> it should be removed
(text): ---> Should NOT Be Removed
Note that our pattern contains:
- two parenthesis
- a date betweeen parenthesis
- a : sign after it
(22.11.2023): oooooo (22.11.2023) aaaaaa () and not remove (text between parenthesis)
The above text should return this:
oooooo aaaaaa and not remove (text between parenthesis)
So far I can remove parenthesis and its containing text like this, but need a hand to fix this
console.log(string.replace(/ *([^)]*) */g, " "))