Boost logo

Boost :

From: Alberto Ganesh Barbati (AlbertoBarbati_at_[hidden])
Date: 2008-02-02 06:15:23

Marshall Clow ha scritto:
> I am in need of a library to parse/encode/decode URLs.
> A quick look through the boost tree doesn't yield any obvious candidates.

That would be a most welcome addition. It doesn't have to be anything as
complex as Boost.Filesystem. Something like Python urlparse might be
enough for most use cases.

> Before I dive into writing my own, does anyone have any
> pointers/recommendations?

In the meantime, you can use Boost.Regex or Boost.Xpressive. According
to a suitable regex is the following:


if $n are the groups produced by the regex, the parts of the url are as

       scheme = $2
       authority = $4
       path = $5
       query = $7
       fragment = $9

There is also an example in Boost.regex using token iterators, see (search for "url").



Boost list run by bdawes at, gregod at, cpdaniel at, john at