aggin23 1 Posted August 1, 2017 Report Share Posted August 1, 2017 Hi guys, I had read few forums about regex but I couldn't find any ready fix for my problem. Code : <li><span>Avg MMR</span><!-- react-text: 6038 -->9554<!-- /react-text --></li>I want to get the highlighted numbers.This will be the only one line of code from scrape attribute, the number can be 3,4 or 5 digits long.So I need something like - get 3,4 or 5 digits after --> and before <!-- . Quote Link to post Share on other sites
Bill 7 Posted August 1, 2017 Report Share Posted August 1, 2017 This worked for me (?<=\-\-\>)[0-9]*(?=\<\!\-\-) 1 Quote Link to post Share on other sites
bestmacros 60 Posted August 1, 2017 Report Share Posted August 1, 2017 should also work :(?<=\>)\d+ 1 Quote Link to post Share on other sites
aggin23 1 Posted August 1, 2017 Author Report Share Posted August 1, 2017 (edited) Ahhh both regex codes are scraping numbers longer than 5 digits.NVM fixed my problem with your code and regex in scrape attribute. Thank you guys ! Edited August 1, 2017 by aggin23 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted August 2, 2017 Report Share Posted August 2, 2017 For the record this will get the numbers between those those comments but only 3-5 numbers: (?<=-->)\d{3,5}(?=<!--) 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.