Hello I have a question about matching groups based on the following regular expression
static string partPattern = @"^(?<Key>\w+)\s*(?<Value>.*)$";
Sample Data as following:
TEST_REPLICATE
{
REPLICATE_ID 1986
ASSAY_NUMBER 877
ASSAY_VERSION 4
ASSAY_STATUS "Research"
}
I am able to retrieve values correctly and if values are NULL, it works correctly as well. What I am trying to do is to also retrieve a value for instance the last one module which is in double quotes. I am not really sure if i am doing it correctly, would this be the correct regex for the above scenario, I just added quotes before w. Please correct, thanks
static string partPattern = @"^(?<Key>\"w+)\s*(?<Value>.*)$";
Not sure where your problem is. This works for me: