CharlieTango 3 Posted November 8, 2011 Report Share Posted November 8, 2011 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. Quote Link to post Share on other sites
blumi40 222 Posted November 8, 2011 Report Share Posted November 8, 2011 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] Quote Link to post Share on other sites
CharlieTango 3 Posted November 8, 2011 Author Report Share Posted November 8, 2011 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 Quote Link to post Share on other sites
blumi40 222 Posted November 8, 2011 Report Share Posted November 8, 2011 Thanks. Doesn't seem to be working yet. Here's a pic of my code. try this Quote Link to post Share on other sites
CharlieTango 3 Posted November 8, 2011 Author Report Share Posted November 8, 2011 try this 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. Quote Link to post Share on other sites
blumi40 222 Posted November 8, 2011 Report Share Posted November 8, 2011 charlie...my example only figure out how it could work ... if u need a programmer let me know :D Quote Link to post Share on other sites
Pete 121 Posted November 8, 2011 Report Share Posted November 8, 2011 www.*\.match = www.comments.watch5. www.*\)match = www.comments.watch5.remove('session_token=OrZ8s3puVKXbmSQINJQP4aZ3mw98MEAxMzIwNzQ0NTg3') (?<=www.comments.watch5.remove)\(.*\)match = ('session_token=OrZ8s3puVKXbmSQINJQP4aZ3mw98MEAxMzIwNzQ0NTg3') Quote Link to post Share on other sites
CharlieTango 3 Posted November 8, 2011 Author Report Share Posted November 8, 2011 yt.www.comments.watch5.remove\(('session_token=[a-zA-Z0-9]+')\) Figured out what I was doing wrong. Turns out I wasn't "escaping" the brackets and needed to. Cheers for the help! Quote Link to post Share on other sites
UBotBuddy 331 Posted November 8, 2011 Report Share Posted November 8, 2011 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") Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.