Boost logo

Boost-Build :

Subject: Re: [Boost-build] boost::regex_search url/uri match help
From: Simply Seven (simply7_at_[hidden])
Date: 2009-03-31 05:24:25


John,
The original as found in the sipx library which uses PCRE:

// UsernameAndPassword
// requires and matches the trailing '@'
// $1 matches user
// $2 matches password
const RegEx UsernameAndPassword(
    "("
       "(?:"
          "[a-zA-Z0-9_.!~*'()&=+$,;?/-]++"
       "|"
          "%[0-9a-fA-F]{2}"
       ")+"
     ")"
    "(?:" ":"
         "("
         "(?:"
             "[a-zA-Z0-9_.!~*'()&=+$,-]++"
         "|"
            "%[0-9a-fA-F]{2}"
         ")*"
       ")"
     ")?"
     "@"
                                    );

This doesn't take in boost::regex.

-s7

On Mar 31, 2009, at 1:42 AM, John Maddock wrote:

>> 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):
>
> What regex did you use with pcre? They should behave exactly the
> same, did you mean to use
>
> "[something]+\\+"
>
> ie "something" is repeated and then followed by a literal "+"?
> Rather than:
>
> "[something]\\+\\+"
>
> which matches a literal "something++" which doesn't I think occur in
> a URL?
>
> John.
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build



Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk