Kev 69 Posted December 30, 2019 Report Share Posted December 30, 2019 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 Quote Link to post Share on other sites
pash 504 Posted December 31, 2019 Report Share Posted December 31, 2019 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).*?(?=&)")) Quote Link to post Share on other sites
Kev 69 Posted December 31, 2019 Author Report Share Posted December 31, 2019 Never mind, got it working thanks Pash 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.