Hey this may have been asked elsewhere somewhere but i couldnt seen to find it.
Essentially im just trying to remove the a tags from a string using regex in javascript.
So i have this:
<a href="www.google.com">This is google</a>
and i want the output to just be "this is google". How would this be done in javascript using regex? Thanks in advance!!
SOLUTION:
Ok so the solution i was provided from my boss goes as follows
The best way to do that is in two parts. One is to remove all closing tags. Then you’re going to want to focus on removing the opening tag. Should be as straightforward as:
/<a\s+.*?>(.*)<\/a>/
With the .*? being the non-greedy version of match /anything/