22 Feb
2009
22 Feb
'09
10 a.m.
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.