View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JeffMelton JeffMelton is offline
external usenet poster
 
Posts: 17
Default Regular expressions

I've been working with some html and am trying to use regular
expressions to get a value. Here is what I'm looking for
"handStatus[0] = '(I need this data)';"

I need to find the part that says I need this data, the () are not part
of the string but the ' are. This is what I've tried, but I've never
really worked with Regexp, could somebody tell me what I need to fix?

Set RegEx = New RegExp
anyStr = myIE.document.body.innerText
RegEx.Pattern = "handStatus[0] = '(\w)';"
RegEx.IgnoreCase = True
RegEx.Global = True ' Set global applicability.
Set match = RegEx.Execute(anyStr) ' Execute search.
MsgBox (match.Value)

Thanks