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
  • 97,193
  • 102
  • 206
  • 364
ramkumar
  • 269
  • 1
  • 3
  • 10

2 Answers2

1

One possibility:

value="([^"]*)"

The data you want is in the first group.

Ingo
  • 36,037
  • 5
  • 53
  • 100
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
  • 7,631
  • 10
  • 43
  • 56