Pekka Niiranen <krissepu at vip.fi> writes: > Is it possible to compile a single regular expression that covers both > the cases ? In general, regular expressions are lousy when it comes to nested constructs. Maybe you are better of not using them here, a simple parser could be easier here.