View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Regular Expression Conditionals (?(if)then|else) in VBA?

Okay, but if I understand your larger goal (checking to ensure multiple
left/right brackets in a text string are paired), this (again, non-RegEx)
code might work for you...

If UBound(Split(Variable, "<")) = UBound(Split(Variable, "")) And _
Not Variable Like "*<[!]<*" And Not Variable Like "*<[!]<*" Then

--
Rick (MVP - Excel)


"Lazzaroni" wrote in message
...
Rick:

That is correct, but within a larger string. I am looking for unclosed
brackets using a data validation application that uses rules written in
RegEx. It checks the contents of cells in Excel, based on a unique column
identifier.

Thanks.

Thomas