Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex将文本复制到特定字符之前的另一个字符_Regex - Fatal编程技术网

Regex将文本复制到特定字符之前的另一个字符

Regex将文本复制到特定字符之前的另一个字符,regex,Regex,我收到了一条像那样的长文本。我需要将第一个“部分”复制到第二个“部分”,然后再复制;每行 预期结果 "test" = "data"; "text" = "data"; "this" = "data"; 什么正则表达式可以做到这一点呢?在正则表达式模式下尝试以下查找和替换: "test" = "test"; "text" = "text"; "this" = "this"; Find: "(.*?)" = ".*?" Replace: "$1" = "$1"

我收到了一条像那样的长文本。我需要将第一个“部分”复制到第二个“部分”,然后再复制;每行

预期结果

"test" = "data";

"text" = "data";

"this" = "data";

什么正则表达式可以做到这一点呢?

在正则表达式模式下尝试以下查找和替换:

"test" = "test";

"text" = "text";

"this" = "this";

Find:    "(.*?)" = ".*?"
Replace: "$1" = "$1"