0

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 from above hidden element?

Soner Gönül
  • 91,172
  • 101
  • 184
  • 324
ramkumar
  • 259
  • 1
  • 3
  • 10

2 Answers2

1

One possibility:

value="([^"]*)"

The data you want is in the first group.

Ingo
  • 34,949
  • 5
  • 49
  • 97
0

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}=)?\".*/
Community
  • 1
  • 1
StKiller
  • 6,955
  • 8
  • 39
  • 56