Skip to content

Instantly share code, notes, and snippets.

@Noitidart
Last active November 14, 2017 23:49
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 Noitidart/9444208 to your computer and use it in GitHub Desktop.
Save Noitidart/9444208 to your computer and use it in GitHub Desktop.
regex pattern for release

Find: ^.*?console\.(warn|info|log|error|exception).*?$ Replace with: ``

@yajd
Copy link

yajd commented Apr 18, 2014

code to run on replace all. puts comment before each one:
Find what: (.*?)console\.(warn|info|log|error)
Replace with: $1//console.$2

@Noitidart
Copy link
Author

Find:
^.*?console\.(warn|info|log|error|exception|time|timeEnd|jsm).*?$
Replace with: ``

@Noitidart
Copy link
Author

Noitidart commented May 28, 2017

vscode

(^)(.?console.(?:warn|info|log|error|exception|time|timeEnd|jsm).?)($)

$1//$2$3

@Noitidart
Copy link
Author

Noitidart commented Aug 1, 2017

vscode

remove them

(^)//(\s*?)// console
$1$2console

(^)//(\s*?console)
$1$2

// add it back:

(^)[^/](.*?console.)
$1//$2

@Noitidart
Copy link
Author

Noitidart commented Sep 22, 2017

submlime

add slashes (comment out console's)

find:
(^)(\s*?)console
replace with:
$1$2// console

@Noitidart
Copy link
Author

vscode

remove all console. lines:

.*?console.*
replace with: ``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment