I uploaded a new patch that addresses Amar's comments.
1. Can you please add some comments as to what the regex is supposed to do? Comments for each of the capturing groups w.r.t what are they planning to compare/match themselves against would be good enough.
2. Can we reuse the regex declared in o.a.h.mapred.JobHistory? Seems similar to me.
Yes, they are based on the regex from yhadoop 20. However, this is not available in trunk. So I have to copy it over.
3. In the testcase, you could define your values in unescaped format and use StringUtils to escape it.
Used StringUtils's escapeString and unescapeString directly. I also added a few more unit tests that should be covering all cases as included in the testcase you wrote.