开发者

Validate <param> Using Javascript Parser

How can I validate

<param name="controller" value="true"></param>

AND

<param name="controller" value="true" />

Using same Javascript Parser string. Currently I'm using /(<param[\s|\S]*?>)[\s|\S]*\/>/i; which only validates second pa开发者_StackOverflow社区ttern.

Thanks in advance!


/<param.*?(?:\/>|><\/param>)/i

matches both of them. See example on Rubular.


You may try this

<param[^>.]+(/>[^<]|[^/]></param>)

Now it will match only the first two of the four below

<param name="controller" value="true"></param>

AND

<param name="controller" value="true" />

AND 

<param name="controller" value="true"/></param>

AND 

<param name="controller" value="true">
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜