开发者

Regular expression to extract the value of hidden element

I have html pages with hidden element as below:

< input type=hidden id="xl_aux2" name="xl_aux2" value="???" >

Value contains base64 string. So what will be the regular expression that I can use to extract the value开发者_JS百科 from above hidden element?


One possibility:

value="([^"]*)"

The data you want is in the first group.


There is an answer with regular expression for Base64 encoded string :

RegEx to parse or validate Base64 data

So the result expression will be like this :

/.*value=\"(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\".*/
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜