Skip to content

Instantly share code, notes, and snippets.

@matthewfeickert
Created September 25, 2021 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewfeickert/b817904f22dc4add80e021337d2e8b79 to your computer and use it in GitHub Desktop.
Save matthewfeickert/b817904f22dc4add80e021337d2e8b79 to your computer and use it in GitHub Desktop.
Regular expressions help

If you enclose a regex in parentheses () whatever is enclosed can be used in a search and replace by a number that is indexed starting with 1. So for example

\section{\sc Research Interests}

can be found with the regex

\\section\{\\sc (.*?)\}

and replaced with

\section{\normalfont \textsc{Research Interests}}

by using the regex replace pattern

\section{\\normalfont \\textsc{$1}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment