Dreamweaver 的“搜索”和“用通配符替换”是否有可变选项?

发布于 2024-09-07 10:13:42 字数 441 浏览 4 评论 0原文

假设我有很多区域,例如:

乔正在打吉姆,

乔正在踢吉姆,

乔正在向吉姆吐口水。

我想找到 joe is _____ jim 的每个案例,并完全改变顺序。通常我只会进行通配符搜索,然后搜索并替换“joe is [^”]* jim”。但是如果我想保留通配符是什么并简单地重新排列单词怎么办?(有点像使用 [^"] 作为替换窗口中的变量)。

基本上我想做的是搜索并将“joe is [^”]* jim”替换为“jim is [^”]* joe”(没有“[^”]*”字面显示为替换文本)。我知道有人可能会说

“你为什么不只搜索并替换 jim 和 joe,并忽略 [^”]* ?”

好吧,如果通配符可以作为搜索和替换中的变量存储,那么您可以执行 1 中需要多个步骤的操作。

如果不是 Dreamweaver,是否有任何其他编码环境可以让您执行此操作?

Lets say I have a bunch of areas like:

joe is punching jim

joe is kicking jim

joe is spitting on jim.

and I wanted to find every case with joe is _____ jim and completely change the order around. normally I would just do a wilcard search, and search and replace "joe is [^"]* jim". but what if i wanted to KEEP whatever the wildcard was and simply rearrange the words? (kinda like using [^"] as a variable in the replace window).

basically what I want to do is search and replace "joe is [^"]* jim" with "jim is [^"]* joe" (without "[^"]*" literally appearing as the replaced text). I know someone will probably say

"why don't you just do search and replaces for both jim and joe, and ignore the [^"]* ?"

well if the wildcard could be stored as a variable in the search and replace, then you can do what would take multiple steps in 1.

if not dreamweaver, are there any other coding environments that will let you do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮倦 2024-09-14 10:13:42

搜索 joe is ([^<]*) jim 并替换为 jim is $1 joe

如果您有多个 ([^<]*) 通配符,您可以使用 $1, $2, $3... 引用所有通配符

找到它 此处

Search for joe is ([^<]*) jim and replace with jim is $1 joe.

If you have several ([^<]*) wildcards, you can refer to all of them with $1, $2, $3...

Found it here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文