Hi,
I have the following regular expression for matching a URI/URL(works fine with PCRE, note I have escaped ++ to work with boost::regex but otherwise unchanged):
const boost::regex regex_username_password(
"("
"(?:"
"[a-zA-Z0-9_.!~*'()&=+$,;?/-]\\+\\+"
"|"
"%[0-9a-fA-F]{2}"
")+"
")"
"(?:" ":"
"("
"(?:"
"[a-zA-Z0-9_.!~*'()&=+$,-]\\+\\+"
"|"
"%[0-9a-fA-F]{2}"
")*"
")"
")?"
"@"
);
For the life of me I cannot figure out why it isn't working. The boost::test results looks like so:
failed [10.1.2.33 != test]
... error in "test_http_url": check url == u.to_string() failed [sip:test@10.1.2.33 != sip:test]
... error in "test_http_url": check url == get_uri(u) failed [sip:test@10.1.2.33 != sip:test]
I believe it is the regex, here is the iterator position, etc...
iterator position = ':'
if (boost::regex_search(it, str.end(), matches, UsernameAndPassword))
{
assert(0); // never reached
}
Any help here would be great, thanks!