Use Regular Expressions to Extract Data Fields in VB.NET
Posted on 2009-03-31
I need to use regular expressions to extracted data fields in a string received from a device attached to a serial port. The strings look like the one below:
The data I want extracted is the one in braces. Using the sample string above, regex should extract the data as follows:
Field1= "" ' i.e. empty screen because there is no data in the first set of braces ()
Field2 = "300,600,1200,2400,4800,9600,19200,38400,57600,115200,230400" ' i.e. data in the second set of braces
There may be more braces with data in the received strings. The returned data can be in a single keyed list e.g.
Any idea how I can best implement this in VB.NET?