Boost logo

Boost :

From: Lorenzo Bettini (bettini_at_[hidden])
Date: 2007-04-29 06:17:16


is there a way to access the subexpressions in a tree-like manner?

For instance, suppose I have this regular expression


that matches against this string


the results are

prefix: test
what[0]: "ooo"
  what[1]: "ooo"
  length: 5
  what[2]: "
  length: 1
  what[3]: "
  length: 1
suffix: foo

I need to format the matched part with tags, say, like this


but in order to do this, when I inspect what[1], I'd need to know that
it has two subexpressions, while I cannot know that what[2] and what[3]
are indeed subexpressions of what[1]...

That is to say, subexpressions are flattened.

thanks in advance

Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)

Boost list run by bdawes at, gregod at, cpdaniel at, john at