Created
May 7, 2016 23:25
-
-
Save rniswonger/e8773cc532490b0aeb6ff0422c52945d to your computer and use it in GitHub Desktop.
RegEx to find html atributes
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
All attributes: | |
(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']? | |
A specific attribute (ex. class): | |
(class)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']? | |
Test it: | |
https://www.debuggex.com/r/KL_pMoR8_pERK-ah | |
Credit: | |
http://stackoverflow.com/questions/317053/regular-expression-for-extracting-tag-attributes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment