Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code: \n in regex file search not supported?

I'm trying a simple regex search with "\n" to find a line feed and some String(s) around. In a single file search it´s working fine (see screenshot on the right), but in a folder search I get the error "Literal '\n' not allowed" (see screen shot on the left). Any idea?

Screenshot

Cheers Daniel

like image 856
Daniel D. Avatar asked Apr 20 '18 13:04

Daniel D.


1 Answers

I believe this error is coming from ripgrep, which VSCode uses by default for this search function. I found this comment by the owner, referencing \n in particular.

Fortunately, you can tell VSCode not to use ripgrep in your settings.json:

"search.useRipgrep": false

With ripgrep disabled, \n should work as expected.

like image 59
Mike Patrick Avatar answered Sep 20 '22 02:09

Mike Patrick