I want to remove this patterns in the text:
<code>(22.11.2023): ---> it should be removed
(): ---> it should be removed
(22.11.2023) ---> it should be removed
(text): ---> Should NOT Be Removed
</code>
<code>(22.11.2023): ---> it should be removed
(): ---> it should be removed
(22.11.2023) ---> it should be removed
(text): ---> Should NOT Be Removed
</code>
(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
<code>(22.11.2023): oooooo (22.11.2023) aaaaaa () and not remove (text between parenthesis)
</code>
<code>(22.11.2023): oooooo (22.11.2023) aaaaaa () and not remove (text between parenthesis)
</code>
(22.11.2023): oooooo (22.11.2023) aaaaaa () and not remove (text between parenthesis)
The above text should return this:
<code>oooooo aaaaaa and not remove (text between parenthesis)
</code>
<code>oooooo aaaaaa and not remove (text between parenthesis)
</code>
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
<code>console.log(string.replace(/ *([^)]*) */g, " "))
</code>
<code>console.log(string.replace(/ *([^)]*) */g, " "))
</code>
console.log(string.replace(/ *([^)]*) */g, " "))