Cisco Interview Question

long string submatch problem? code it in any language. questions related to threads, mutexs, etc