// using System; // using System.Collections; // using System.Collections.Generic; // using System.Text.RegularExpressions; // using System.ComponentModel; // using BCG.Utilities; // namespace BCG { // public class RegexMatchAdder : ColumnAdder { // private int[] myAddedColNos; // private string mySrcCol; // private Regex myRegex; // public RegexMatchAdder (string srcCol, string columnDef, string regex) : base (columnDef) { // mySrcCol = srcCol; // myRegex = new Regex (regex); // } // public override IBlueRow map (IBlueRow row) { // MutableBlueRow result = new MutableBlueRow (mySchema, row); // if (myAddedColNos == null) { // myAddedColNos = new int[myNewColumns.Count]; // for (int i = 0; i < myAddedColNos.Length; ++i) // myAddedColNos[i] = i + row.Count; // } // object[] values = new object[myNewColumns.Count]; // string src = (string)row[mySrcCol]; // // extract the requested regex substrings // Match m = myRegex.Match (src); // for (int icol = 0; icol < myAddedColNos.Length; ++icol) { // int i = icol + row.Count; // Group g = m.Groups[mySchema.columnNames[i]]; // object val = TypeDescriptor.GetConverter (mySchema[i].colType) // .ConvertFromString (g.Success ? g.Value: string.Empty); // result.setValue (i, val); // } // return result; // } // } // }