Skip to main content
edited tags
Link
xanatos
  • 112.4k
  • 13
  • 209
  • 296
Source Link
raagavan
  • 1k
  • 3
  • 13
  • 16

whats wrong with my c++ regex match

i am writing an robots.txt parser in c++

 boost::regex exrp( "^User-agent:\s*(.*)"); boost:: match_results<string::const_iterator> what; if(boost::regex_search( robots, what, exrp ) ) { string s( what[1].first, what[1].second ); cout<< s; } 

this should match the useragent with name * but it it returns all datas