Public Member Functions | |
object[] | Scan (string text, string fieldSpecification) |
void | Scan (string text, string fieldSpecification, params object[] targets) |
|
Scan memics scanf. A master regular expression pattern is created that will group each "word" in the text and using regex grouping extract the values for the field specifications. Example text: "Hello true 6.5" fieldSpecification: "{0} {1} {2}" and the target array has objects of these types: "String, ,Boolean, Double" The targets are scanned and each target type is extracted in order to build a master pattern based on these types The fieldSpecification and target types will result in the generation of a master Pattern: ([]+)+(true|false)+([-]|[.]|[-.]|[0-9][0-9]*[.]*[0-9]+) This masterPattern is ran against the text string and the groups are extracted and placed back into the targets |
|
Scan memics scanf. A master regular expression pattern is created that will group each "word" in the text and using regex grouping extract the values for the field specifications. Example text: "Hello true 6.5" fieldSpecification: "{String} {Boolean} {Double}" The fieldSpecification will result in the generation of a master Pattern: ([]+)+(true|false)+([-]|[.]|[-.]|[0-9][0-9]*[.]*[0-9]+) This masterPattern is ran against the text string and the groups are extracted. A string that may contain simple field specifications of the form {Int16}, {String}, etc object[] that contains values for each field |