Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2006-04-11 07:32:31


> I'm trying to use the regex library in order to validate a generic
> URI according to the regular expression specified in RFC 3986 -
> Uniform Resource Identifier (URI): Generic Syntax.
>
> Here is the expression:
>
> ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
>
> As far as I know this is a POSIX compliant regex. I'm building my
> regex with the following flags:
>
> boost::regex::basic | boost::regex::icase

It's *not* a POSIX-basic expression (POSIX basic doesn't support parenthesis
or the + operator).

Use it as a POSIX-extended expression, or actually it'll work as a perl
expression as well (and is likely to be more efficient as well).

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net