Skip to content

Instantly share code, notes, and snippets.

@displaynone
Created October 30, 2018 15:28
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 displaynone/e622cb1edba52065640f907d0d52c1c1 to your computer and use it in GitHub Desktop.
Save displaynone/e622cb1edba52065640f907d0d52c1c1 to your computer and use it in GitHub Desktop.
Matching attributes with quotes inside quoutes
//
const regex = /[\w_-]+=(['"])((?!\1).)+\1/gu;
`<div data-slogan="Don't do it" data-warning='Use double quotes (")'>`.match( regex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment