Sorry, i just noticed i have replaced your code with mine. This function is also valid, but for single Character only.
Following is the complete code
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System.Text.RegularExpressions;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
public override void PreExecute()
{
base.PreExecute();
}
public override void PostExecute()
{
base.PostExecute();`enter code here`
}
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
if (Regex.IsMatch(Row.ID, "^(0|[1-9][0-9]*)$"))
{
Row.isvalid = true;
}
else
{
Row.isvalid = false;
}
}
I have updated the regular expression. hope it helps