我有一些包含下划线块的字符串。例如:
*Text* _word_ it is something we read every day. _Words in texts_ can be really expressive. _A nice text is a pleasure for your body and soul_ (Oscar Wilde)
在上面的示例中,有三个这样的块,但每个字符串的数量都不同。我只想匹配最后一个,即从行末开始懒惰地跳过字符,直到找到第一个下划线,跳过任何后续字符,直到遇到第二个下划线并停止。
如果我们要查找字符串中第一个块,那么很容易找到类似的块,但是如何找到最后一个呢?