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

prasantha kumara <>
Fri Feb 13 12:41:24 CET 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090213/2b229a7e/attachment.html>


More information about the erlang-questions mailing list