开发者

retrieve quoted string using expression language

How to retrieve the quoted value of a property.

suppose you have some expression like:

[html:text property="pqrs" styleClass="text" style="width:200px"].

And now i want to retrieve the value of property, styleclass and style ie "pqrs", "text" and "width:200px" respectively.

开发者_JS百科

Can you guys please help me in this.

thanks a lot.


If you just want the text in quotes, a non-greedy match should work:

".*?"


(\w+)\=\"(.*?)\"

The first capture group (\w+) gives you the attribute name, and the second capture group uses a non-aggressive operator to match things inside quotes.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜