I am looking for the correct Perl one-liner to remove all instances of a particular regular expression from a text file.
Namely, I want to remove all instances of [ immediately followed by a capital letter, then followed by any number of characters and spaces until ]. For instance,
[CP 5.491] or
[MS 283: 56 (variant) in Colapietro, 1989, p. XIV].
I would like to accomplish this in Perl because the simple script I wrote to process my files is otherwise already in that language.
After trying out the two perfectly adequate answers below, I realized that I made one mistake in my original question (sorry!): I would also need to delete instances where the left bracket is followed by
cf instead of a capital letter, for instance
[cf. CP 2.282]. How would I add that parameter?