Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
any regex experts here?
trying to validate a string passed in to see if it refers to a valid excel range name "a1" or "A1" to "iv65536" or "IV65536" this clearly isn't it, i'm a regex dunce! Regex regex = new Regex("[a-zA-Z][a-iA-I][a-vA-V][1-65536]"); this is no good either Regex regex = new Regex("[a-zA-Zaa-ivAA-IV][1-65536]"); bool b; b = regex.IsMatch("x1"); Debug.Print(b.ToString());//true b = regex.IsMatch("1a"); Debug.Print(b.ToString());//false b = regex.IsMatch("AC65536"); Debug.Print(b.ToString());//true b = regex.IsMatch("IV65537"); Debug.Print(b.ToString());//false b = regex.IsMatch("IV65536"); Debug.Print(b.ToString());//true any tips appreciated i suppose i could parse the incoming string and separate the alpha and numeric parts but with regex that shouldn't be necessary, right? thanks mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Testing For a RangeName | Excel Discussion (Misc queries) | |||
Confused with RangeName CellREfs | Excel Discussion (Misc queries) | |||
union of RangeName | Excel Programming | |||
Concatenate RangeName for INDEX? | Excel Worksheet Functions | |||
Validate Excel Range with RegEx | Excel Programming |