Question : Regular expression in C++

Currently I am trying to do a pattern match and print the value matched using regular expression in C++. However I am not familiar with C++ because I am more of a perl person, hope someone can help. I understand there is a regex.h library but I am not sure how to use.

Input String ==> "This is a paper "
regex ==> "\<(.*?)\>
Desired output ==> "sample"

Answer : Regular expression in C++

>> regcomp() and regexec()

Use regcomp to compile the regex you wish to run
Use regexec to execute the regex against a target
Use regfree to free the regex created using regcomp
Use regerror to get a string version of any error codes

Usage, with examples, is documented here
http://www.opengroup.org/onlinepubs/000095399/functions/regcomp.html
Random Solutions  
 
programming4us programming4us