【问题标题】:Find and replace word if only its line contains specific string (Regex Dreamweaver) [closed]如果仅其行包含特定字符串(Regex Dreamweaver)[关闭],则查找并替换单词
【发布时间】:2014-06-04 16:57:18
【问题描述】:

我想在 Dream weaver 中使用 Find and Replace 仅查找和替换其行包含特定字符串的单词。

【问题讨论】:

标签: regex replace find dreamweaver


【解决方案1】:

user3503851,Dreamweaver 具有臭名昭著的劣质正则表达式风格。不过,这是一个在 CS6 中测试过的工作示例。

我们的测试文本:

My Untitled Document Is Here
My Beautiful Document Is Here
My Document, the Beautiful

目标:将“文档”替换为“博客”,但仅在包含“美丽”一词的行中

搜索: ((?=.*?Beautiful)[^\r\n]*)(Document)

替换:$1Blog

结果:

My Untitled Document Is Here
My Beautiful Blog Is Here
My Blog, the Beautiful

【讨论】:

  • @user3503851 欢迎您。嘿,我注意到你还没有在 StackOverflow 上投票。如果此答案或其他答案解决了您的问题,请考虑通过单击左侧的复选标记和箭头来“接受”,因为这就是信誉系统的工作方式。当然,没有义务这样做。稍后,当您获得更多声誉时,您也可以提出问题。感谢收听我的 20 秒 SO 教程。 :)
猜你喜欢
  • 2015-10-13
  • 2016-12-06
  • 1970-01-01
  • 2023-04-04
  • 2022-11-19
  • 2023-04-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多