I would like to remove all the line codes in brackets placed at the beginning of lines but want to preserve the other words in brackets.
NOTE:
In the application that I use I cannot import any Python library but can use Python regexes. The regex and the replacement value in the substitution have to be separated by a comma. For example, I use ([^\s\d])(-\s+),\1
to merge hyphenated words at the end of lines. So I would need something similar.
\([^()]*\)
finds every text in brackets.
^\h*\([^()]*\)
finds only the first one but not the rest.
How should I modify it?
The sample text is the following:
(#p0340r#) This is a sentence. This is another one but I need more sentences to fill the space to start a new line.
(#p0350q#) Why? (this text should be left unchanged)
(#p0360r#) Because I need to remove these codes from interview texts.
The expected outcome should be:
This is a sentence. This is another one but I need more sentences
to fill the space to start a new line.
Why? (this text should be left unchanged)
Because I need to remove these codes from interview texts.
Thank you!