Hello All, I really dislike making Excel Macro's :-(
Here is the typical string I am working with:
· Identify & document site-related constraints and assumptions.
I would like to scrub that string to get rid of everything before "Identify"...
I wrote a function to take the string and scrub it, here it is:
Function dataScrub(dataIn As String)
Dim dataIn_orig As String
dataIn_orig = dataIn
'BEGIN : create and set regular expression
Dim regEx
Set regEx = CreateObject("vbscript.regexp")
With regEx
.IgnoreCase = True
.MultiLine = False
.Pattern = "^[\s]*[·]+[\s]*"
.Global = True
End With
dataScrub = regEx.Replace(dataIn_orig, "")
End Function
For an unknown reason, the replace is replacing the · (not a period, more like a bullet) but not getting rid of the spaces that follow it, so my end result is:
Identify & document site-related constraints and assumptions.
When I test my regEx using an online tester (http://www.regular-expressions.info/javascriptexample.html), it works as intended.
Any help would be greatly appreciated!