简体   繁体   中英

vs-code: Append a text to multiple opened files using regex?

I'm trying to append some text to multiple files. Is this possible in VS-Code with Edit->"Replace in Files" using regex?

在此处输入图像描述

\z (only the end of text) is not working here - invalid regular expression.

You may match the end of line that has no character immediately to the right:

$(?![\w\W])

Here, $ matches an end of line position and (?![\w\W]) is a negative lookahead that fails the match if any char appears immediately to the right of that location.

See the regex demo where m flag is enabled and makes $ match end of line positions, as in Visual Studio Code, and due to (?![\w\W]) it only matches at the very end of the text.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM