Thread: C# regex help
View Single Post
Old 06-01-2009, 08:56 AM   #8 (permalink)
kmote
 

Join Date: Jul 2005

Location: England

Posts: 2,164

kmote has a spectacular aura aboutkmote has a spectacular aura about

Default Re: C# regex help

I also hate regex but in theory something like this might work
\d{1,3}(\.\d{1,3}){3}

this should look for 0-9 between 1 and 3 times then a dot followed by 1-3 numbers 3 times. In practise limited repetition ({1,3} etc.) is not always supported and you may be forced to use + instead. Occasionally \d isn't supported either in which case you can replace it with [0-9].

Filled with hate
__________________
MSI P43 Neo|Enermax Pro82+ 425W|E5200|silent 8500GT|250GB Samsung spinpoint F1|Samsung SATA DVD RW|4GB Corsair|Antec SOLO|openSUSE11


There are in order of increasing severity: lies, darn lies, statistics, and computer benchmarks. - diskinfo man page
kmote is online now