开发者

retrieve quoted string using expression language

开发者 https://www.devze.com 2023-02-16 10:36 出处:网络
How to retrieve the quoted value of a property. suppose you have some expression like: [html:text property=\"pqrs\" styleClass=\"text\" style=\"width:200px\"].

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

精彩评论

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