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}=)?\".*/
精彩评论