Overview
Features
Download
Documentation
Community
Add-Ons & Services

Use Regular Expression with Poco

Please post support and help requests here.

Use Regular Expression with Poco

Postby ShrewMouse » 10 Oct 2008, 05:44

Hi All,

When I use regular expression to extract a string, it look like return the first match of the target string:
RegularExpression re(pattern, options);
std::string returnString;
int returnMatch = re.extract(line, returnString);

So if returnMatch >= 2 , how can I get the string of second match ?

Thanks for any helps,
Dat
ShrewMouse
 
Posts: 9
Joined: 01 Oct 2008, 04:45

Re: Use Regular Expression with Poco

Postby guenter » 10 Oct 2008, 10:16

You have to do it by hand. See the source code for extract(), which simply calls match(). Then call the match() function returning the result in a vector (MatchVec), and extract the string yourself (substr()).
guenter
 
Posts: 1129
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Re: Use Regular Expression with Poco

Postby ShrewMouse » 10 Oct 2008, 11:26

> You have to do it by hand. See the source code for extract(), which simply calls match(). Then call the match() function returning the result in a vector (MatchVec), and extract the string yourself (substr()).

I get it, thanks
ShrewMouse
 
Posts: 9
Joined: 01 Oct 2008, 04:45


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron