<div dir="ltr"><br>Well, it's in R12B-3, and here's part of my session:<br><br>14> {ok, RE} = re:compile("^ *(\\d{4})/(\\d{1,2})/(\\d{1,2}) *$"). <br>{ok,{re_pattern,3,0,<br>
<<69,82,67,80,103,0,0,0,16,0,0,0,5,0,0,0,3,0,0,0,0,0,47,<br> ...>>}}<br>15> re:run("2008/09/14", RE, [{capture, all_but_first, list}]). <br>
{match,["2008","09","14"]}<br><br>All I did from the command line was type in erl, nothing else.<br><br>HTH<br>Edwin<br><br><div class="gmail_quote">On Sun, Sep 14, 2008 at 2:01 PM, 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;">Neat! But...<br>
I'm running R12-4, and looking at the<br>
/usr/local/lib/erlang/releases/R12B/start.script I can see the re<br>
module. But it doesn't seem to be accessible from the erl prompt, even<br>
though application:which_applications() lists stdlib as started. I'm<br>
confused...<br>
<div class="Ih2E3d"><br>
Olivier Pernet<br>
<br>
We are the knights who say<br>
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq'|dc<br>
<br>
<br>
<br>
</div>On Sun, Sep 14, 2008 at 6:34 PM, Steve Vinoski <<a href="mailto:vinoski@ieee.org">vinoski@ieee.org</a>> wrote:<br>
> re is in R12B-4, the latest release, so it's already included.<br>
<div><div></div><div class="Wj3C7c">><br>
> On 9/14/08, Olivier Pernet <<a href="mailto:o.pernet@gmail.com">o.pernet@gmail.com</a>> wrote:<br>
>> Thanks, re looks just about right. I was hoping for a standard library<br>
>> solution at first... How fast do the OTP libraries evolve ? Any chance<br>
>> of this being included someday ?<br>
>><br>
>> Olivier<br>
>><br>
>> On Sun, Sep 14, 2008 at 9:42 AM, Edwin Fine<br>
>> <<a href="mailto:erlang-questions_efine@usa.net">erlang-questions_efine@usa.net</a>> wrote:<br>
>> > Take a look at the re module. It has exactly what you need.<br>
>> ><br>
>> > On Sun, Sep 14, 2008 at 3:04 AM, Olivier Pernet <<a href="mailto:o.pernet@gmail.com">o.pernet@gmail.com</a>> wrote:<br>
>> >><br>
>> >> 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<br>
>> >> 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>
>> ><br>
>> ><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>
><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>
</div></div></blockquote></div><br></div>