I am using TR1 Regular Exions (for VS2010) and I am trying to search for a specific template for a group called "name" and another template for a group called "value". I think what I want is called a capture group, but I'm not sure if this is the correct terminology. I want to assign matches to the pattern "[^: \ r \ n] +): \ s" in the list of matches called "name", and matches to the pattern "[^ \ r \ n] +) \ r \ n) +" in a list of matches called "value".
The regex pattern that I still have is
string pattern = "((?<name>[^:\r\n]+):\s(?<value>[^\r\n]+)\r\n)+";
But the TREREX regular expression header continues to throw an exception when the program starts. What is wrong with the syntax of the template that I have? Can someone show an example of a template that will do what I'm trying to execute?
Also, how could you include a substring in a template so that it matches, but doesnβt actually include that substring in the results? For example, I want to combine all the lines of a template
"http://[[:alpha:]]\r\n"
but I donβt want to include the substring "http: //" in the returned results of matches.
source share