# 如何在嵌入设置中为标题使用正则表达式？

**URL:** <https://meta.discourse.org/t/how-do-i-use-regular-expressions-for-title-in-embedding-settings/151024>\
**Category:** Product Support\
**Created:** [2020 年5 月 11 日 08:47 UTC](https://meta.discourse.org/t/how-do-i-use-regular-expressions-for-title-in-embedding-settings/151024 "2020-05-11T08:47:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

作者： ![spanrucker](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@spanrucker](https://meta.discourse.org/u/spanrucker)\
发布日期： [2020 年5 月 15 日 07:35 UTC](https://meta.discourse.org/t/how-do-i-use-regular-expressions-for-title-in-embedding-settings/151024/2 "2020-05-15T07:35:26Z")

</div>

我已经解决了这个问题，以防其他人也会遇到同样的情况。我把事情想得太复杂了！

在标有“_用于清理帖子标题的正则表达式_”的输入框中，你只需填入希望清理停止的位置，并在末尾加上 $。例如，如果网页的 HTML 标题是“我的帖子名称 - 我的网站名称”，你可以在框中输入“- 我的网站名称$”（不要包含引号），这样在 Discourse 中创建的帖子就不会包含标题的这一部分。

希望这能说得通，也希望对其他人有所帮助！

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-use-regular-expressions-for-title-in-embedding-settings/151024)._
