<p dir="ltr">Hi,<br>
If re module make your heart pounding,<br>
you may give a try to <a href="https://github.com/crownedgrouse/swab">https://github.com/crownedgrouse/swab</a> <br>
and create powerful macros to apply on your buffers. <br></p>
<p dir="ltr">"Envoyé depuis mon mobile " Eric</p>
<br><br>---- lloyd@writersglen.com a écrit ----<br><br>Hello,<br><br>A naive question. <br><br>But every time I look into the re module my heart starts pounding. I spend uncountable time figuring out what I need to do. But this time I failed.<br><br>Suppose I have the following string:<br><br> "<h1>Hello!</h1>\n <h2>How are you?</h2>\n <p>Some text\n and more text.</p>"<br><br>I would like to break it into a list:<br><br> ["<h1>Hello!</h1>", "<h2>How are you?</h2>", "<p>Some text\n and more text.</p>"]<br><br>string:token(MyString, "$\n") doesn't work because it would break the paragraph. <br><br>So I try:<br><br> re:replace(Copy, [$>,$\n], [$>,$",$,,$"], [global, {return, list}]).<br><br>But I get:<br><br> "<h1>Hello!</h1>\",\" <h2>How are you?</h2>\",\" <p>This is....<br><br>I don't want those pesky escaped quotes at the end of the heads. I want the real deal. <br><br>But how can I make it happen?<br><br>Thanks and holiday cheer to all,<br><br>LRP<br><br><br><br><br><br><br><br><br><br><br><br><br>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br>