0
類似Find and Replace RegEx question查找/替換,排除字符
所有我需要做的是找到兩個短語之間的字符串,「文字」和「編輯[;」,並以相同的字符串替換,省略所有「/ /」。我不認爲括號內反向引用是我想要的,因爲我正在使用的文本文件非常龐大,通常有3個,每個字符串中有時最多有10個「//」。
此:
// --- Literal
//
//At the same time as that, joining in the music
//will be fun, I think.
// --- Edited
應該成爲這樣的:
// --- Literal
At the same time as that, joining in the music
will be fun, I think.
// --- Edited
(記事本+ +不支持換行字符在正則表達式,但不相關的問題,在實際的文字我已經做了\ n爲「nline」的查找替換。)
這是我到目前爲止:
Find: // --- Literalnline//(.*?)//(.*?)//(.*?)//(.*?)// --- Edited // \[;
Replace: // --- Literalnline\1\2\3\4// --- Edited // \[;