in reply to Re (tilly) 3: parsing question
in thread Re: parsing question
> The RE engine does have the power to solve this problem.
Hrm.. please demonstrate. I know you can build a lexer by looping over m/\G$regexp/g, but that doesn't give you the state storage neccessary to balance parens. If you could whip up something to convert the second-level parens in:
(((())()))(()(()()))
to square brackets:
([(())()])([][()()])
using only regexps.. no variables, no recursion (and for arbitrary strings of nested parens, of course).. I'd love to add the technique to my bag of tricks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 5: parsing question
by tilly (Archbishop) on Jan 08, 2002 at 06:23 UTC | |
|
(MeowChow) Re4: parsing question
by MeowChow (Vicar) on Jan 08, 2002 at 06:02 UTC | |
by mstone (Deacon) on Jan 09, 2002 at 01:04 UTC |