May 19, 2016, 11:19 PM
Post #2 of 2
Nope. Even for simpler cases, a regex is simply not the right tool. Here, it is a typical example where you just can't do it with a regex. Well, you could possibly build a complicated regex that would work for that very specific case, but you would have to make many assumptions about the exact format, so that the regex would break if anything is slightly different or for more general case.
Don't try to do that, you'd be bound to failure.
Even using several regexes would not save your day, or you would end up building yourself a clunky and unpractical mini-parser, use a parsing module for that.