开发者

Regex to select span ID

Kindly help me know the regex to select only span id for a given span markup. I'm trying to do it from inside c#. My input is like . And I want as an output only >> id="x8x8d9s8" <<

Currently I'm trying to 开发者_开发技巧achieve above as follows but no luck, unfortunately ...

string innerPattern = @"(id=)\""|&quot;|(.)*\""|&quot;|";

Please note its only the start span tag, I do not want to include end span tag i.e.

Any help would be greatly appreciated.

Thanks in advance.


What about this :

(id=".*?")

In C# :

@"(id="".*?"")"

Tried on this regex tester with tagada <span id="test" tagada />

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜