I have used this awesome post in the post for getting query string data from the URL: How can I get query string values in JavaScript?
However, i am now in a situation where the query string values are base64 encoded, e.g:
"param1": "yA26LZ6+SxFEgNuF86/SIXfimGlg="
"param2": "f4x0Dh*6iZCXtX8nhiSb3xahNxrg="
I've done some research and apparently this regex can handle base64:
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
How can i adapt the function to incorporate this regex?
What i am trying to do is create a JavaScript function that looks are the URL, can gets the value for a particular paramter:
wwww.mydomain.net/reset.html?param1=76+hgfh5464/rte69&?userId=23243*--++/231\
Here you cans see 2 parameters:
param1
userId
=
padding is breaking the standard regex. I'm not sure query strings support having values with=
in them. – Evan Knowles yesterday