An example of positive lookbehind (Matches a group before the main expression without including it in the result):
var str = @"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ApplicationException: MQException is caught. Reason code: 2033, completion code: 2. ---> CompCode: 2, Reason: 2033
--- End of inner exception stack trace ---
at Multiconn.ZZZ.Web.Services.Port.EndProcess(IAsyncResult asyncResult)
at Multiconn.ZZZ.Demo.K.M.E(IAsyncResult asyncResult, WsEsParams1Response& result1, MyType result3)
--- End of inner exception stack trace ---";
Regex r = new Regex(@"(?<=Reason code: )\d+");
foreach (Match m in r.Matches(str))
Console.WriteLine(m.Value);
Keeping track of interesting places I put my feet on in the software development world.
Search This Blog
Monday, February 22, 2016
Sunday, February 21, 2016
Impefect Content-Type http response headers
Subscribe to:
Posts (Atom)