split "lines" into array

I want to split HTML text divisions into an array for further parsing.

The HTML is rather simple, only <br> and <p> separating text.
How can split the text into an array as if I were using:

lines = text.split("\n");

but with <br> & <p> instead of "\n"?

thanks.
LVL 14
EsopoAsked:
Who is Participating?
 
ZvonkoSystems architectCommented:
Like this:

lines = text.split(/(<br>|<p>)/i);

0
 
darksinclairCommented:
Try this :

lines = text.split(chr(13));

chr(13) is the carriage return.  I think that's what your looking for.

Cheers.
0
 
EsopoAuthor Commented:
Beautiful!

Thank you.
0
 
ZvonkoSystems architectCommented:
You are welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.