Skip to content

Instantly share code, notes, and snippets.

@JorgenHookham
Last active October 12, 2015 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JorgenHookham/3990573 to your computer and use it in GitHub Desktop.
Save JorgenHookham/3990573 to your computer and use it in GitHub Desktop.
regex_toolbelt.js
/////////////////////
// Merge Conflicts //
/////////////////////
(?s)<<<<<<< HEAD(.*?)=======(.*?)>>>>>>> [a-z_0-9\-]+
///////////////////
// HTML Analysis //
///////////////////
// Find a class name in HTML
// Make sure to update SASS extensions at the same time as your HTML! (@extend .SEEK_THIS_CLASS)
class=.*[" ]SEEK_THIS_CLASS.*"
// Find a tag with a class name in HTML
div.*class=.*[" ]SEEK_THIS_CLASS.*"
//////////////////////////
// Media Query Analysis //
//////////////////////////
// Find @media queries containing main breakpoints
@media.*(480|768|1200).*?\)
// Find @media queries that do not contain main breakpoints
@media(.(?!480|768|1200))*?\)
//////////////////////////
// Find Front End TODOs //
//////////////////////////
// sublime text find in files include/exlude paths (not a regex)
*.coffee,*.js,*.html,*.scss,*.css,-*/lib/*
// exclude TODOs by subject. ex: TODO(?!\[ajax\-csrf\]) excludes TODO[ajax-csrf]
TODO(?!\[subject\])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment