Need help with Regex!

thetoothfairy

Elite Member
Joined
Apr 24, 2016
Messages
2,139
Reaction score
553
Hello. I've trying to scrape this text from html with Regex for hours but sill no luck. Please some who is expert at Regex help me with this. It's very simple, so I have this text in the html : " vid_length : '789'. I want to extract only the '798' from the text. What's the correct Regex for this?
 
Hello. I've trying to scrape this text from html with Regex for hours but sill no luck. Please some who is expert at Regex help me with this. It's very simple, so I have this text in the html : " vid_length : '789'. I want to extract only the '798' from the text. What's the correct Regex for this?

you don't need regex for this , just use simple string manipulation , anyways which language you are using ?
 
you don't need regex for this , just use simple string manipulation , anyways which language you are using ?
I'm not writing the code. I use a program call "Webharvy" to scrape info from a page and it require regex in order to scrape this info
 
Thanks man. So the final code would be : vid_length:/\'[0-9]*\'/g .Right?
not really, depends what the string is. it should be something like this:
content = ".......vid_length: '789'...."
depends on the programming language but for js for example
regex = /\'[0-9]*\'/g
var match = content.match(regex);
console.log(match[0]); // this will be '789'
 
Back
Top