Posted By

brandonjp on 12/11/15


Tagged

regex javascript js regexp console log comments logs Angular angularjs


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

brandonjp


RegExp to find JS & Angular non-comment logs


 / Published in: Regular Expression
 

URL: http://refiddle.com/refiddles/js-and-angular-non-comment-logs

Regular Expression to find native Javascript console and AngularJS $log log warn or info that are NOT comments / commented out

  1. /^(\s*)?[^\/]{0,2}((\$log|console)\.(warn|log|info))(.*)$/gmi
  2.  
  3. in Sublime Text: ^(\s*)?[^\/]{0,2}(\$log\.(warn|log|info))(.*)$
  4.  
  5. test/play here: http://refiddle.com/refiddles/js-and-angular-non-comment-logs

Report this snippet  

You need to login to post a comment.