Re: extract the data from buffer

ben <[email protected]>
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
this /RE/ should match the desired 3 numbers (inside parenthesis):

/^([0-9]*) of ([0-9]*) max .* ([0-9]*\.*[0-9]*)% of.*/
- ben
Jai Sharma a écrit :
> Hi
> 
> I want to extract variables values from a string buffer. Can anyone
> pleease tell me how can i do that.
> In C how to use perl like regular expressions.
> 
> [...]
> SIP/63.111.11.135-09 tsihomephoneservice@ Up      Queue(tsihomephoneservice||||9
> 10 active channels
> 5 of 200 max active calls ( 2.50% of capacity)
> 
> 
> I want to extract three numeric data fields from last line:
> as
> 
> %d of %d max active calls ( %l% of capacity)
> result : 5,200,2.50
> 
> means 2.5
> 
> 
> Thanks and Regards
> 
> Jai
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.