Jeromy Anglim's Blog: Psychology and Statistics


Showing posts with label regular expressions. Show all posts
Showing posts with label regular expressions. Show all posts

Wednesday, March 10, 2010

Using Regular Expressions in R: Case Study in Cleaning a BibTeX Database

I recently had to clean up a BibTeX database containing around 1,000 references. One of the clean up tasks was to ensure that page numbers were separated with en-dashes as opposed to hyphens. This post sets out how I used regular expressions in R to complete the task and check the results. I also hope to highlight the general power of string manipulation in R.