Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Enclose expressions that includes a word using regural expresion in visual code

i have a script where i use many times the command

console.log(‘anything inside’)

how can i change them with regural expression into visual code or any other editor, to be like this

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

if(display_comments==true){console.log(‘anything inside’)}

where the "anything inside" and be any phrase.

>Solution :

You can use search and replace with the following search:

console.log\('(.*)'\)

And replace with:

if(display_comments==true){console.log('$1')}

Don’t forget to enable "Use regular expression" toggle next to the search input.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading