Home |
Search |
Today's Posts |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sun, 29 Apr 2007 16:17:10 -0400, Ron Rosenfeld
wrote: On Sun, 29 Apr 2007 15:04:07 -0400, "Dana DeLouis" wrote: What I'm thinking is that maybe something like "A 123 k" might test True by ignoring the "A", and "ABC j 123 k" might test True by finding the pattern within a larger string. I guess one question which has not been answered is the reason for the regex. Is it to extract any matching pattern from the string; or is it to ensure that only the desired pattern is present. If the latter, then your expression is appropriate. --ron Reading the OP's post again (and looking at his macro), it does seem as if he wants to either match, or not match, the specific pattern. So your addition of ^ and $ would indeed be warranted. And it's also possible to detect the format without regular expressions: =============================== For Each c In rRng If c.Text Like "[JjXxZz] ### [A-Za-z]" Or _ c.Text Like "### [A-Za-z]" Then Debug.Print c.Text, "TRUE" Else Debug.Print c.Text, "FALSE" End If Next c ================================ --ron |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Regex techniques | Excel Programming | |||
RegEx to parse something like this... | Excel Programming | |||
RegEx Replacement patterns | Excel Programming | |||
RegEx in VBE code editor | Excel Programming | |||
Regex Question | Excel Programming |