I have recently been busy with a number of essay assignments on my university course. Most of these essays have a word limit but citations made within the body of the essay text are not to be included in this word count.
To save me from manually removing these citations from the essay, a tedious process, I discovered that I could use regular expressions to find and remove all citations in one particular text.
For most essays, the Harvard system of (author date) citation is used, for example:
(Chan 1991)
Therefore, to match this quotation, I needed a regex that would match any brackets in which there was a single word starting with a capital letter followed by a four digit number. I came up with the following:
\([A-Z][a-z]*[ ][0-9][0-9][0-9][0-9]\)
Using this regular expression in a find & replace operation in a text editor, quotes can be quickly removed in bulk from a text – whilst ensuring that other information contained within brackets is not removed.
Timesaver!
Tags: citations, essay, expressions, harvard, quotations, regular
I’m trying to fix references in a dissertation. I’ve never used regular expressions extensively, but this could get me started quite nicely.
Thanks!
good luck!