Hi, I want to create a regular expression which will return the content within the <body> tags of a string. I have retrieved the string but I can't get the regular expression to work. I've tried:
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.MultiLine = True
objRegExp.Pattern = "<body>(.*?)</body>"
vblContent = objRegExp.Replace(vblContent,"$1")
Set objRegExp = nothing
I hoped that it would return the bit in brackets as $1 and replace the original string with everything within the body tags but it does not work. Appreciate it if someone could help. Thanks
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.MultiLine = True
objRegExp.Pattern = "<body>(.*?)</body>"
vblContent = objRegExp.Replace(vblContent,"$1")
Set objRegExp = nothing
I hoped that it would return the bit in brackets as $1 and replace the original string with everything within the body tags but it does not work. Appreciate it if someone could help. Thanks