Skip to content

Instantly share code, notes, and snippets.

@jvanja
Last active December 27, 2015 14:59
Show Gist options
  • Save jvanja/7344608 to your computer and use it in GitHub Desktop.
Save jvanja/7344608 to your computer and use it in GitHub Desktop.
Regex for search and replace in between two strings: string 'start' and string 'end', using 'look ahead' and 'look behind'.
(?<=start)(.*)(?=end) // lazy - it will select until LAST occurence
(?<=start)(.*?)(?=end) // not lazy - it will select until FIRST occurence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment