This relates more to the field of standalone analyzer / lexical analyzer. But ANTLR has a pretty nice binding to C # if it suits your goals.
It would probably not be very much work to write a simple parser for strings of this kind and do the reduction yourself.