I have a question regarding REGEX-Matches. I loop through a Datatable which variables are empty sometimes. If they are empty, I get the error code “Object reference not set to an instance of an object” when trying to assign it to a variable. What is a good way to solve this? String.IsNullorEmpty doesn’t work properly.
You can validate, through the “Result”, if there is a match or not.
You can also put your regex sequence inside a try catch where in the catch you put the variable empty.