Regex Split problem, probably a no brainer.

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2009
Posts: 1
Reputation: evildrome is an unknown quantity at this point 
Solved Threads: 0
evildrome evildrome is offline Offline
Newbie Poster

Regex Split problem, probably a no brainer.

 
0
  #1
May 4th, 2009
Hi All,

I've got a VC++ dll with Boost 1_34_1 regular expressions in it. I am a programmer but not VC++ or Regex.

The program worked fine until the target HTML format (sPage) was changed and I need to get the regexs updated. I got them updated OK. I checked them all with RegexBuddy and individually, they all work. I substituted the old regexs for the new but now after the regex split command the output-iterator (oMessageInfo) contains only the output of the first regular expression.

I looked at the Boost docs website ( http://www.boost.org/doc/libs/1_31_0...gex_split.html ) regarding the regex_split command

"Effects: Each version of the algorithm takes an output-iterator for output, and a string for input. If the expression contains no marked sub-expressions, then the algorithm writes one string onto the output-iterator for each section of input that does not match the expression. If the expression does contain marked sub-expressions, then each time a match is found, one string for each marked sub-expression will be written to the output-iterator."

Unfortunately I have no idea what a 'marked sub-expression' is.

Hoefully someone here can spot the schoolboy mistake.


  1. const std::string sMessages1 =
  2.  
  3. "<td class=\"msgnumh smalltype\">\#([0-9]*)<\/td>"
  4. "(?:[\s\S]*?)From:(?:<\/em>)?(?:<\/span>)?(?:[\s]*)?(?:&quot;)?([^&]*)(?:&quot;)?(?:[\s]*)?&lt;([^&]*)&gt;"
  5. "(?:[\s\S]*?)Date:(?:<\/em>)?(?:<\/span>)?[\s]*([^<]*)(?:<br>)?"
  6.  
  7.  
  8. boost::regex oRegExMessages1(sMessages1, boost::regbase::normal | boost::regbase::icase);
  9.  
  10. boost::regex_split(std::back_inserter(oMessageInfo), sPage, oRegExMessages1);


Cheers,

Wilson.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC