This topic created in 3723 days ago, the information mentioned may be changed or developed.
s/$/regexp/g 貌似不行?能不能有类似效果
就是在行尾,追加一个 正则表达式 匹配出来的 string
5 replies • 2016-08-13 22:13:03 +08:00
 |
|
1
ethsol Aug 13, 2016
/regexp/{s/$/\1/g}
这样搞貌似也报错
|
 |
|
2
ethsol Aug 13, 2016
/(regexp)/{s/$/\1/g} \1 无法传入 {} 里面?
|
 |
|
4
neilp Aug 13, 2016 1
``` sed 's/\(.*\)\(regexp\)\(.*\)/\1\2\3\2/' ```
|