[erlang-questions] get string from <<"string">> in erlang

Hynek Vychodil <>
Fri Feb 13 13:42:36 CET 2009


try binary_to_list/1

2009/2/13 prasantha kumara <>

> hi all i tried to authenticate the received request from erlang
> i recieved the follwing binary.
> <<"POST / HTTP/1.1\r\nCookie: x=y\r\nUser-Agent: Jakarta
> Commons-HttpClient/3.0.1\r\nHost: 127.0.0.1:9000\r\nContent-Length:
> 34\r\nContent-Type:
> application/x-www-form-urlencoded\r\n\r\nUserName=prasantha&Password=abc123">>.
> ** exception error: no match of right hand side value <<"POST /
> HTTP/1.1\r\nCookie: x=y\r\nUser-Agent: Jakarta
> Commons-HttpClient/3.0.1\r\nHost: 127.0.0.1:9000\r\nContent-Length:
> 34"...>>
>
>
> i can split  "POST / HTTP/1.1\r\nCookie: x=y\r\nUser-Agent: Jakarta
> Commons-HttpClient/3.0.1\r\nHost: 127.0.0.1:9000\r\nContent-Length:
> 34\r\nContent-Type:
> application/x-www-form-urlencoded\r\n\r\nUserName=prasantha&Password=abc123">>.
> ** exception error: no match of right hand side value <<"POST /
> HTTP/1.1\r\nCookie: x=y\r\nUser-Agent: Jakarta
> Commons-HttpClient/3.0.1\r\nHost: 127.0.0.1:9000\r\nContent-Length: 34"
> using
> regexp:split(Request, "UserName=")
>
> request id the recived binary without the << and  >>.
>
> but i cannot filter the the string without << >>
> signs.can any body help me to filter the string from the <<"string">>.
>
>
> thanking in advance.
> prasantha
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



-- 
--Hynek (Pichi) Vychodil

Analyze your data in minutes. Share your insights instantly. Thrill your
boss.  Be a data hero!
Try Good Data now for free: www.gooddata.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090213/783fd640/attachment.html>


More information about the erlang-questions mailing list