qlithe
Supreme Member
- Feb 14, 2012
- 1,252
- 288
Hey!
I have this piece of html:
And I want to use preg_match_all to get all the words except the html tags including the link. I've been trying to solve this for too long now so I decided to make a topic for some help. I want the result to look like this:
This
is
a
sentence
with
a
inside
This is the regex so far:
and I have tried with different methods like lookahead, lookbehind etc but I just cant get it to work. It currently includes
p
a
href
and part of the link and anchor
I have this piece of html:
HTML:
<p>This is a sentence with a <a href="http://google.com">link</a> inside</p>
And I want to use preg_match_all to get all the words except the html tags including the link. I've been trying to solve this for too long now so I decided to make a topic for some help. I want the result to look like this:
This
is
a
sentence
with
a
inside
This is the regex so far:
Code:
/(\w+)/
and I have tried with different methods like lookahead, lookbehind etc but I just cant get it to work. It currently includes
p
a
href
and part of the link and anchor