<div dir="ltr">Take a look at the re module. It has exactly what you need.<br><br><div class="gmail_quote">On Sun, Sep 14, 2008 at 3:04 AM, Olivier Pernet <span dir="ltr"><<a href="mailto:o.pernet@gmail.com">o.pernet@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br>
<br>
I'm new to Erlang, and trying not to reinvent the wheel to do some<br>
basic string processing.<br>
I'm reading a line that has a room name and a message, separated by<br>
one (or more) whitespace characters, and terminated by <crlf>.<br>
Is there a way to tell regexp:split() to please give me back the<br>
groups matched by the regexp ?<br>
Here's my first attempt :<br>
regexp:split("  \t  \t room  \t hello world   \r\n", "[<br>
\t]*([^\s\t\r\n]+)[ \t]+([^\r\n]*)\r\n").<br>
I'd like to get back something like ["room", "hello world  "] with this example.<br>
<br>
Thanks for your help,<br>
Olivier Pernet<br>
<br>
We are the knights who say<br>
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq'|dc<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</blockquote></div><br></div>