K Vij
K Vij

Reputation: 2063

Comment out flutter print statements in vs code

I would like to comment out all the print statements in my flutter code. I am using VS Code. I would also like to preserve the spacing if possible. I have tried some regular expressions but I am not able to capture the space before he print statement. Would anyone know the regex for find/replace in VS code to do this?

I am trying this ^(\s)*\1print, but it says back references not allowed?

Upvotes: 2

Views: 797

Answers (1)

K Vij
K Vij

Reputation: 2063

Actually, this worked pretty nicely:

Find: ^(\s*)print

Replace: $1// print

Looks like we don't need to use back references in vs code. And remember to turn the little .* icon ON to allow regex search/replace.

Upvotes: 1

Related Questions