匹配字符串而不是子字符串 [英] Match string not substring

查看:131
本文介绍了匹配字符串而不是子字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑一个字符串
DummyColumnVaEPSI_t_LoresSubCyl_T6 [x] _ [27] > (VaEPSI_t_LoresSubCyl_T6 [x] _ [16] + VaEPSI_t_LoresSubCyl_T6 [x] _ [27] )

现在,当我将 VaEPSI_t_LoresSubCyl_T6 [x] _ [27] 替换为'' VaEPSI_t_LoresSubCyl_T6 [x] _ [27] ''.
显示的输出是
DummyColumn''VaEPSI_t_LoresSubCyl_T6 [x] _ [27]''> (VaEPSI_t_LoresSubCyl_T6 [x] _ [16] + ''VaEPSI_t_LoresSubCyl_T6 [x] _ [27]'')

我只想要完全匹配的字符串作为

DummyColumnVaEPSI_t_LoresSubCyl_T6 [x] _ [27] > (VaEPSI_t_LoresSubCyl_T6 [x] _ [16] + ''VaEPSI_t_LoresSubCyl_T6 [x] _ [27]'')

请帮助

在匹配字符串之前和替换字符串中包含一个空格.

 AAAABBB> (CCC + BBB)

搜索"BBB"并将其替换为" BBB""


Consider a string
DummyColumnVaEPSI_t_LoresSubCyl_T6[x]_[27] > (VaEPSI_t_LoresSubCyl_T6[x]_[16] + VaEPSI_t_LoresSubCyl_T6[x]_[27])

Now when I replace VaEPSI_t_LoresSubCyl_T6[x]_[27] by ''VaEPSI_t_LoresSubCyl_T6[x]_[27]''.
output shown is
DummyColumn''VaEPSI_t_LoresSubCyl_T6[x]_[27]'' > (VaEPSI_t_LoresSubCyl_T6[x]_[16] + ''VaEPSI_t_LoresSubCyl_T6[x]_[27]'')

I want only exact string match as

DummyColumnVaEPSI_t_LoresSubCyl_T6[x]_[27] > (VaEPSI_t_LoresSubCyl_T6[x]_[16] + ''VaEPSI_t_LoresSubCyl_T6[x]_[27]'')

Plz help

解决方案

So include a space before the match string, and in the replacement.

AAAABBB > (CCC + BBB)

Search for " BBB" and replace it with " ''BBB''"


这篇关于匹配字符串而不是子字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆