Jump to content
UBot Underground

How to strip this text from a file...


Recommended Posts

Hey, I'm trying to basically extract the domains from a list of spun resource boxes. Say I have a file with the following three entries (separated by a line break)

 

If {you are|you're} {looking for|searching for|trying to find|seeking|in search of|in need of} information on <a href="http://www.cnn.com">{search engine help|example test|bad anchor text 2| just another example anchor text}</a>

If {you are|you're} {looking for|searching for|trying to find|seeking|in search of|in need of} information on <a href="http://www.dobe.com">{search engine optimization| SEO| more SEO anchor text}.</a>

If {you are|you're} {looking for|searching for|trying to find|seeking|in search of|in need of} information on <a href="http://www.mywebsitedomain.com">{some anchor text|even more text here}</a>

 

How can I extract only the domains to a new list, so that I get this:

 

http://www.cnn.com

http://www.dobe.com

http://www.mywebsitedomain.com

 

I'm thinking I might need to use some sort of .replace with regular expressions and javascript? If anyone can give me a hand here, much appreciated!

 

Ben

Link to post
Share on other sites

Thanks, gave me an idea. I'll just "split" the text using the List from Text on the " delimiter. That will break each "line" into 3 items on a new list. At that point, I can just pick out every even numbered item on the new list -- that will be the domain.

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...