RegEx to find html atributes
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