Skip to content

Instantly share code, notes, and snippets.

@easternnl
Last active May 2, 2019 08:29
Show Gist options
  • Save easternnl/b63f579650de6c5f2b0851962b5561a4 to your computer and use it in GitHub Desktop.
Save easternnl/b63f579650de6c5f2b0851962b5561a4 to your computer and use it in GitHub Desktop.
Regex to capture all text between the two double quote's. Escaped double quotes will not match as end character, but included in capture
The following Regex:
"((?:\\"|[^"])*)"
Will match everything in between double quotes, and skip the escaped double quotes. Try your self at https://regex101.com/r/sbukHC/1
<a
id="link-cms-page-4-2"
class="cms-page-link"
href="http://server:8080\"/en/content/4-about-us"
title="Learn more about \"erik\""
And it will give you the following result:
link-cms-page-4-2
cms-page-link
http://server:8080\"/en/content/4-about-us
Learn more about \"erik\"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment