Regular expression for picking up HTTP input and header

Asked

Viewed 234 times

2

How to construct a regular expression that selects this here?

Set-Cookie: csrftoken=bf8748c0b1e113430d9757cf0ed06f4a; expires=Mon, 04-May-2015 20:54:08 GMT; Max-Age=31449600; Path=/
<input type="hidden" name="csrfmiddlewaretoken" value="676248f0994e62274dea72023fe699ff">

I intend to log in with Curl on instagram.

  • Still can not understand what you want the regular expression select, can explain better?

  • I just want a regex that picks up these cookies and the input understands ?

  • I think I understand, I edited the question again. The first part is an http header right? It’s not part of HTML.

  • exactly that :p

  • 1

    Does using the Instagram API (http://instagram.com/developer) not solve the problem? If you’re logging in to get user information and everything, it’s worth using the API.

  • I just need the regular expression so that

Show 1 more comment

1 answer

1

I didn’t quite understand what the question is asking but, here’s a try.

Try using the following expression:

/csrftoken=([\w]+)\;/

Demo

The second expression:

/value=\"([\w]+)\"/

Demo

Browser other questions tagged

You are not signed in. Login or sign up in order to post.