Table of Contents

1 emacs regexp

These examples can be typed as written into the prompts of query-replace-regexp. For coding these into elisp strings, you need to escape the backslashes: \ -> \\.

  • Find all occurances of $…$ and replace with \eqn{…} in R comments
[ ][$]\([^$]*\)[$]
  • Find all attr(…,"source") and replace with getSource(…) in R code
attr(\([a-z]+\), ?"source")
  • Find all spaces before something and replace them with a comma (useful for converting space-delimited text to csv). Could also use lookahead.
[ ]\([^ ]\)

Author: Toby HOCKING <>

Date: 2011-08-26 14:12:46 CEST

HTML generated by org-mode 6.33x in emacs 23