使用正则表达式在字符串中找到多个实例

Find multiple instances of substring in a string using Regular Expressions?

本文关键字:实例 正则表达式 字符串      更新时间:2023-10-16

我有很多这样的行:

string s = "Some HTML with two <A HREF="links"> in one <A HREF="line">";

我需要使用正则表达式将URL列入引号之间,例如:

string all_links[] = {"links", "line"};

我该怎么做?

根据给定的字符串样本,

。使用[^HREF="]+(?=">)

demo