[erlang-questions] How can I break this string into a list of strings?

Pierre Fenoll pierrefenoll@REDACTED
Sun Dec 25 23:43:56 CET 2016


Hey Éric

Well it's not clear whether tags are nested in the OP.
So when my assumption applies, I would just read the list created 3 elements at a time, with strings of whitespace removed. 

If it doesn't, regexps are known to not be able to parse stack based grammars. 

> On 25 Dec 2016, at 21:41, Éric Pailleau <eric.pailleau@REDACTED> wrote:
> 
> Hi Pierre,
> 
> No this way you are loosing html tags.
> Lloyd wants to keep html tags, including linefeeds inside html tags.
> 
> I tested with re:split(Html, "(<[^>]+>[^<]*<[^>]+>)",[{return, list}]) .  Works. 
> Lloyd can then loop on result and keep only non empty string after trim on elements. 
> Regards 



More information about the erlang-questions mailing list