remove all after this char “)” or a specific word with regex

廉价感情. 提交于 2019-12-08 07:27:10

问题


i have this string

The Walking Dead: Season 1 (DVD) tagged "the walking dead" 61 times

and i need to truncate this string, after this char ")" or delete the word "tagged" and remove all words after this.

Thanks at all.


回答1:


Don't know what language you are using, but this should work.

use this regex:

\).*

And replace it with )




回答2:


(.*)(?:tagged)

The above regex will select everything before tagged.



来源:https://stackoverflow.com/questions/22689439/remove-all-after-this-char-or-a-specific-word-with-regex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!