Thread: C# regex help
View Single Post
Old 06-01-2009, 06:27 AM   #7 (permalink)
S0ULphIRE
S0ULphIRE's Avatar
 
01001100011011110110110

Join Date: Mar 2007

Location: Perth, Australia

Posts: 1,988

S0ULphIRE has a spectacular aura aboutS0ULphIRE has a spectacular aura about

Send a message via MSN to S0ULphIRE
Default Re: C# regex help

Regex pattern = new Regex("[0-9][0-9]{2}.[0-9][0-9]{2}.[0-9][0-9]{2}.[0-9][0-9]{2}");

try that.

edit: this might be easier:

Regex pattern = new Regex("[\d][\d]{0,2}.[\d][\d]{0,2}.[\d][\d]{0,2}.[\d][\d]{0,2}");

C# and Regex
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a dour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American."
-- Douglas Adams

Click this if I helped you
>>>><<<<

Last edited by S0ULphIRE; 06-01-2009 at 06:39 AM.
S0ULphIRE is offline