Skip to content

Instantly share code, notes, and snippets.

@thomasxbanks
Created July 15, 2019 11:22
Show Gist options
  • Select an option

  • Save thomasxbanks/c36de51908ea3196ef6aec2db285b652 to your computer and use it in GitHub Desktop.

Select an option

Save thomasxbanks/c36de51908ea3196ef6aec2db285b652 to your computer and use it in GitHub Desktop.
regex Search: Uncommented console.logs
\w*(?<!\/\/)console.log
@thomasxbanks
Copy link
Author

Finds all uncommented console.log that aren't preceded by //
Useful for dropping into global search in VS Code for find/replace comment/uncomment of logs

@sugoidesune
Copy link

sugoidesune commented Mar 29, 2023

matches // console.log(

found this

^( *)(?!# console)((console\.log)+.*)$

src: https://regex101.com/library/buRyeO?filterFlavors=javascript&orderBy=MOST_RECENT&page=4

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