Jump to content
UBot Underground

Can't seem to figure out how to use regex


Recommended Posts

I need to extract the session_token from the following line of code, but am having difficulties. I thought I may have to "escape" the .'s but, that doesn't seem to work

 

www.comments.watch5.remove('session_token=OrZ8s3puVKXbmSQINJQP4aZ3mw98MEAxMzIwNzQ0NTg3')

 

Thanks for any help.

Link to post
Share on other sites

I need to extract the session_token from the following line of code, but am having difficulties. I thought I may have to "escape" the .'s but, that doesn't seem to work

 

www.comments.watch5.remove('session_token=OrZ8s3puVKXbmSQINJQP4aZ3mw98MEAxMzIwNzQ0NTg3')

 

Thanks for any help.

something like that could works but not tested

=.*[a-zA-Z0-9]

Link to post
Share on other sites

something like that could works but not tested

=.*[a-zA-Z0-9]

 

Thanks. Doesn't seem to be working yet. Here's a pic of my code.

 

http://content.screencast.com/users/CharlieTango/folders/Jing/media/5a32d7ba-3a42-4d46-a134-3a78f4d431a5/2011-11-08_0606.png

Link to post
Share on other sites

try this

post-3548-0-43966200-1320751465_thumb.jpg

 

That works if we're just extracting from the one line of code, as you are with #test, but the thing is, there are several lines of code that match that criteria in the $document text.

 

I need to identify this particular session token based on the "www.comments.watch5.remove" part that precedes it.

Link to post
Share on other sites

www.*\.

match = www.comments.watch5.

 

www.*\)

match = www.comments.watch5.remove('session_token=OrZ8s3puVKXbmSQINJQP4aZ3mw98MEAxMzIwNzQ0NTg3')

 

(?<=www.comments.watch5.remove)\(.*\)

match = ('session_token=OrZ8s3puVKXbmSQINJQP4aZ3mw98MEAxMzIwNzQ0NTg3')

Link to post
Share on other sites

For those who find Regex to difficult and too time consuming for simple things like this. Try this

 

set(#var, "www.comments.watch5.remove('session_token=OrZ8s3puVKXbmSQINJQP4aZ3mw98MEAxMzIwNzQ0NTg3')", "Global")

set(#var, $replace($replace(#var, "www.comments.watch5.remove(\'session_token=", ""), "\')", $nothing), "Global")

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...