Hi! I have a question about regexp: How can i write a regex , to match this string: +OK user -- Regards, Groleo! .''`. # touch universe : :' : # chmod +rwx universe `. `'` # ./universe `- Debian - when you have better things to do than fix a system
Groleo Marius wrote:
Hi!
I have a question about regexp: How can i write a regex , to match this string:
+OK user
regex("^\\+OK user$") Seriously, now, presumably you're trying to parse messages from a POP3 server, and where you wrote "user" you're expecting to see a username? If that's the case, I think you need to read RFC 1939 again, because it doesn't specify any responses that include a username. Most positive responses are "+OK" followed by arbitrary text. Ben.
First thanks for the reply :)
For me, it worked something like this:
\+*OK[[:space:]]**\w*[[:space:]]*\w*\W
Second, about the RFC, it metters only the positive
response, +OK that is. The rest, is up to the server
implementation.
On Tue, 15 Mar 2005 17:53:33 +0000, Ben Hutchings
Groleo Marius wrote:
Hi!
I have a question about regexp: How can i write a regex , to match this string:
+OK user
regex("^\\+OK user$")
Seriously, now, presumably you're trying to parse messages from a POP3 server, and where you wrote "user" you're expecting to see a username? If that's the case, I think you need to read RFC 1939 again, because it doesn't specify any responses that include a username. Most positive responses are "+OK" followed by arbitrary text.
Ben. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Regards, Groleo! .''`. # touch universe : :' : # chmod +rwx universe `. `'` # ./universe `- Debian - when you have better things to do than fix a system
participants (2)
-
Ben Hutchings
-
Groleo Marius