Boost logo

Boost Users :

Subject: Re: [Boost-users] Regex win vs. linux
From: John Maddock (john_at_[hidden])
Date: 2009-02-22 05:00:30


> boost::regex exp("(?is)(https?)://([^:/?#]+):?(\\d{1,5})?/?([^?#]*)?\
> \??([^#]+)?#?(\\w*)");
>
> It runs fine in a linux environment, however if compiled with VC9 on
> windows, it fails with:

The character sequence '??(' is a trigraph that VC++ replaces with '[' - see
http://en.wikipedia.org/wiki/C_trigraph - and this of course breaks your
regex :-(

I'm trying to think of an alternative and failing at present, as splitting
into 2 strings doesn't help (apparently VC++ performs trigraph substitution
after string catenation). Ah this page:
http://msdn.microsoft.com/en-us/library/bt0y4awe.aspx describes the
workaround.

HTH, 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