I have a .txt file out of which I want to erase every instance of square brackets and what's inside them.
Since I also want to delete what's inside the brackets, I don't think a simple search and replace would work.
Do you know of a way to do this, /g/?
e. g.
Original text: "Janitor acceptance [emails] will be sent out over the coming weeks"
Result text: "Janitor acceptance will be sent out over the coming weeks"
>Makes no sense but you get the point
regex.
>>59282236
You can do it on Notepad++ since it has generic terms, so you just replace "[*]" with nothing. Not that the asterisk actually represents "anything", I don't remember what it was. Look it up.
>>59282236
>>59282260
>regex
Vim regex:
:%s/\[.?\]//g
>>59282293
Wow, vim is fucking garbage
>>59282293
Oops, should be
:%s/\[.*?\]//g
Instead
>>59282293
>>59282329
Both are wrong because "asd [dddd] adwjdiojf [klkd] asdasd" will be reduced to "asd asdasd".
":%s/\[[^\]]*\]//g" is closer to what OP wants, though the space still remains which can be added,
>>59282236
Sure sounds like a homework question...