我正在尝试使用正则表达式从字符串中过滤掉一些垃圾文本,但似乎无法使其工作。我不是一个正则表达式专家(甚至离那还很遥远),并且我已经搜索了类似的例子,但没有一个似乎可以解决我的问题。
我需要一个正则表达式,它匹配从字符串开头到特定单词的所有内容,但不包括该单词本身。
以下是一个示例:
<p>This is the string I want to process with as you can see also contains HTML tags like <i>this</i> and <strong>this</strong></p>
<p>I want to remove everything in the string BEFORE the word "giraffe" (but not "giraffe" itself and keep everything after it.</p>
那么,我如何匹配在单词“giraffe”之前的字符串中的所有内容呢?
谢谢!