如何删除特定单词后的文本
我有一个字符串
The best laid schemes of mice and men
如何删除 ColdFusion 中“schemes”一词后面的所有文本?我想这可以用正则表达式来完成。
I have a string
The best laid schemes of mice and men
How do I remove all text after the word "schemes" in ColdFusion? I suppose this can be done with regex.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
给你:
Here ya go:
您的正则表达式是:
并替换为“schemes”
解释
.*$
表示匹配任何字符 (.
) 0 次或多次 (*
) 直到行尾 ($
)Your regex is:
and replace with "schemes"
Explanation
.*$
means match any character (.
) 0 or more times (*
) till the end of the row ($
)尝试这个正则表达式:
将 $1 替换为空字符串“”
Try this regex:
Replace $1 with empty string ""