I need a regex expression to separate each word and br

What I need is super straight forward however I simply cannot figure it out. I am using regex101.com to try and nail down the correct regex but nothing seems to work.

Basically what I need is to create a list of words and <br> tags in an array.

It could be any of these <br> tags, <br>, <br/>, <br >, <br />

So for Lorem ipsum dolor sit amet, consectetur adipiscing elit.<br /><br />Duis eu metus porttitor, maximus elit vitae, sodales leo.

I need an expression that will give me

["Lorem ", "ipsum ", "dolor ", "sit ", "amet, ", "consectetur ", "adipiscing ", "elit.", "<br />", "<br />", "Duis ", "eu ", "metus ", "porttitor, ", "maximus ", "elit ", "vitae, ", "sodales ", "leo. "] 

So far all I have is /\S+\s+/g but this is only looking for spaces.


Category: regex Time: 2016-07-29 Views: 0
Tags: regex

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.246 (s). 12 q(s)