[dba-VB] C# Regex?

Michael Maddison michael at ddisolutions.com.au
Thu Mar 29 01:46:52 CDT 2012


Hi Stuart,

You are possibly right.
This seems to be working at the moment though,   [0-9]+
Have to do the math separately though.
Testing all variants now....

Cheers

Michael M

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart
McLachlan
Sent: Thursday, 29 March 2012 5:40 PM
To: Discussion concerning Visual Basic and related programming issues.
Subject: Re: [dba-VB] C# Regex?

Doesn't look like a case for Regex to me, you need to extract values,
not just match strings.

I'd probably parse  the string into an array based on th space delimiter
and the step through the array, mulitplying umeric values by 1, 60 or
3600 depending on what text is in the subsequent array element.


--
Stuart

On 29 Mar 2012 at 16:04, Michael Maddison wrote:

> Hi Guys,
> 
> Anyone good at regex?
> 
> My strings could look like any of these
> 	1 sec 
> 	11 sec
> 	1 min 5 sec
> 	1 min 26 sec
> 	1 hr  1 min 5 sec
> 	1 hr  12 min 26 sec	
> 
> The goal is to get total # of seconds but splitting into a 
> MatchCollection would do.
> 
> Any takers?
> 
> Cheers
> 
> Michael M
> 
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
> 
> 


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1424 / Virus Database: 2113/4900 - Release Date: 03/28/12



More information about the dba-VB mailing list