Skip to content

Instantly share code, notes, and snippets.

@sosukeinu
Last active August 8, 2017 17:32
Show Gist options
  • Save sosukeinu/4665527 to your computer and use it in GitHub Desktop.
Save sosukeinu/4665527 to your computer and use it in GitHub Desktop.
REGEX:inline tag attributes
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