[erlang-questions] Erlang regex

Igor Ribeiro Sucupira igorrs@REDACTED
Wed May 21 21:56:19 CEST 2008


2008/5/21 Matteo <mcanato@REDACTED>:
> Hi to all,
> i'm a noob of erlang programming. I would like to have some infos about
> extracting a substring from a string....
> Or better, my situation is this:
>
> i have a string:
> str="OK 01 xxxxxxxx\r\n"); // where xxxxxxxx is a string that i dont know


Is this "OK 01 " fixed? If it is, you could just do:
UnknownPart = lists:nthtail(6, Str)

If it's not, please explain what you need.

Also take a look at the regexp module.

Igor.

> and every time change...
>
> and i need to extract the "xxxxxxx" into another string (str2 for exaple).
>
> Sorry for my english.
>
> Best regards
> M.Canato
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list