Brutal 164 Posted May 13, 2012 Report Share Posted May 13, 2012 Here's the situation: 1- I scrape youtube video descriptions and save to a file. 2- Now, I want to use those scraped descriptions in my content submitter, but many of them have url's. 3- I need a way to delete or replace ALL urls within that file, but i have no idea what the url will be or where it will be in the file. 3a- Clarification... This is a bot for other people to use, so I can't know what descriptions they might scrape, so the question is how do i find/replace text (url's in this case) in a file when i do not know exactly what the text is, or exactly where it is? Any help greatly appreciated. Quote Link to post Share on other sites
JohnB 255 Posted May 13, 2012 Report Share Posted May 13, 2012 If you are only trying to replace urls's, you should be able to use regex for that. In Ubot you would use the $replace regular expression function. Here is an example of a regex string looking for urls within full text: \b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|$!:,.;]*[A-Z0-9+&@#/%=~_|$] John Quote Link to post Share on other sites
Brutal 164 Posted May 13, 2012 Author Report Share Posted May 13, 2012 Thanks John, I'll give it a go. 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.