Jump to content
UBot Underground

Recommended Posts

Hi all,

 

I have this text I extracted from a tweet:

 

 

<p class="TweetTextSize  js-tweet-text tweet-text" lang="en" data-aria-label-part="0">ORANGE <a href="/search?q=%24BANANA&src=ctag"

 

What I need to do is regex out the word ORANGE and BANANA - which do change all the time. The structure around it remains the same though.

 

What I mean by regex out is I want these to be added (ORANGE and BANANA) to their own variables, var1 and var2 for example.

 

I have been using $replace but it's just too many steps for my requirements.

 

Any help with this is greatly appreciated.

 

Kev

Link to post
Share on other sites

try

alert($find regular expression("<p class=\"TweetTextSize  js-tweet-text tweet-text\" lang=\"en\" data-aria-label-part=\"0\">ORANGE <a href=\"/search?q=%24BANANA&src=ctag\"","(?<=\"0\">).*?(?=<a)"))
alert($find regular expression("<p class=\"TweetTextSize  js-tweet-text tweet-text\" lang=\"en\" data-aria-label-part=\"0\">ORANGE <a href=\"/search?q=%24BANANA&src=ctag\"","(?<=q=%24).*?(?=&)"))
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...