• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with regex for parsing out <a href="xyz">  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to parse a document and remove <a href="xyz"> and </a> but keep the the txt between <a ..> and </a>. I am having problem coming up with a regular expression that can do the job.

Example: At the <a href="xyz">game</a> we had fun.

regex should produce
At the game we had fun.

I appreciate any help, thanks in advance.

-Deshi
 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
deshi Joe wrote:Hi,

I am trying to parse a document and remove <a href="xyz"> and </a> but keep the the txt between <a ..> and </a>. I am having problem coming up with a regular expression that can do the job.

Example: At the <a href="xyz">game</a> we had fun.

regex should produce
At the game we had fun.



Can you tell us what you tried so far? And what problems you are running into?

Henry
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Do you really need a regex? Can't you find an HTML parser>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!