c++ - Boost:regex_search - match string between brackets -


given part of logstring:

... http/1.1" 206 391402 "-" "applecoremedia/1.0.0.8b117 (ipod; u; cpu os 4_1 mac os x; de_de)"

i need match last substring inside brackets remote system info string.

i'm not regular expressions understanding have escape brackets "\(" , "\)".

now match whole string thought i'd have like:

\(\.*\) dot matching , "*" specifying random amount of dots.

but does't work. neither (\.*) or (.*) expect.

there must problem opening , closing brackets because seg fault when trying match string way.

can me please?

ok sorry bothering you. did trick:

boost::regex f_sourcedir(conf.pstring("filter_sourcefiles")),         f_string(conf.pstring("filter_string")),         m_first(conf.pstring("field0")),             m_second("\\(([^)]+)\\)\"$",boost::regex::perl),         m_third(conf.pstring("field2")),         m_fourth(conf.pstring("field3")); 

seems problem parsing configuration, can't handle such strings. think have change config class...

thx anyway!


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -