Created
October 30, 2018 15:28
-
-
Save displaynone/e622cb1edba52065640f907d0d52c1c1 to your computer and use it in GitHub Desktop.
Matching attributes with quotes inside quoutes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
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