Hey All,
I’m trying to use a simple Regex search inside an Invoke code block, but I’m not having any luck.
The trouble seems to be in importing the Systems.Text.RegularExpressions namespace inside the code block.
I managed to get it declaring a new Regex variable just fine, but then when I try and pass a value to the variable it says it doesn’t recognize it.
If anyone knows how to do this, would be much appreciated. Thanks
Example:
Dim regexp As System.Text.RegularExpressions.Regex
regexp = System.Text.RegularExpressions.Regex(“(\b\w+\b)\sreport”)
Dim m As System.Text.RegularExpressions.Match
m = regexp.Match(row(“Body”).ToString + row(“Subject”).ToString)
Returns:
Message: Error compiling code
error BC30451: ‘Regex’ is not declared. It may be inaccessible due to its protection level. At line 38
System.ArgumentException: Error compiling code
error BC30451: ‘Regex’ is not declared. It may be inaccessible due to its protection level. At line 38