<div><meta charset="utf-8"><div>regexp:split("Hello world, Hello", "[ ]*,[ ]*"). </div><div>{ok,["Hello world","Hello"]}</div></div><div><br></div><div>re:split("Hello world, Hello", "[ ]*,[ ]*",[{return, list}]).</div>
<div>["Hello world","Hello"]</div><div><br></div><div><div>regexp:matches("Hello \n","\n").</div><div>{match,[{7,1}]}</div><div><br></div><div>re:run("Hello \n","\n"). </div>
<div>{match,[{6,1}]}</div></div><div><br></div><div>but i'm not sure why the start position is different here</div><br><div class="gmail_quote">On Tue, Apr 19, 2011 at 3:30 PM, Bengt Kleberg <span dir="ltr"><<a href="mailto:bengt.kleberg@ericsson.com">bengt.kleberg@ericsson.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Greetings,<br>
<br>
I have inherited some code without a test directory. I get the following<br>
compiler warnings:<br>
./compile_funcs.erl:603: Warning: regexp:split/2: the regexp module is<br>
deprecated (will be removed in R15A); use the re module instead<br>
./compile_funcs.erl:645: Warning: regexp:matches/2: the regexp module is<br>
deprecated (will be removed in R15A); use the re module instead<br>
<br>
The lines are:<br>
{ok, Class} = regexp:split(Class0, "[ ]*,[ ]*"),<br>
and<br>
{match,A}=regexp:matches(String,"\n"),<br>
<br>
I thought "[ ]*,[ ]*" would mean:<br>
the character class of " " (space), 0 or many times, followed by literal<br>
"," followed by the character class of " " (space), 0 or many times.<br>
<br>
This is not the case and I am not having any luck with randomly<br>
constructing strings to find one that triggers a Class that is different<br>
from Class0.<br>
<br>
Perhaps someone knows what "[ ]*,[ ]*" really means, and what to replace<br>
these with when using the re module.<br>
<br>
<br>
bengt<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" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>- Ahmed Omar<div><a href="http://nl.linkedin.com/in/adiaa" target="_blank">http://nl.linkedin.com/in/adiaa</a></div><div>Follow me on twitter</div><div><a href="http://twitter.com/#!/spawn_think" target="_blank">@spawn_think</a></div>
<br>