Last active
August 8, 2017 17:32
-
-
Save sosukeinu/4665527 to your computer and use it in GitHub Desktop.
REGEX:inline tag attributes
This file contains hidden or 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
class="[^"']+" | |
style="[^"']+" | |
etc... | |
Also: [\s\S]*? match any content BETWEEN two tags (ie. <br>[\s\S]*?</div>) | |
Can be used like below: | |
let's say you wanted to comment out all <img> tags | |
create a capture group like so `(<img[\s\S]*?>)` | |
then replace with `<!-- $1 -->` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment