The problem is that I really want to do it with a single regex because of the current flow of the program.
Then rework the current flow of the program. A single regex is not the tool you need. Text::Balanced is. Have you read the docs for Text::Balanced yet? It may be that you don't have to redesign your program all that much to use it.
Perhaps you could maintain the current flow if you wrap the dirty-work done by Text::Balanced in a subroutine.
| [reply] |
Well, I'm not going to claim it's impossible to do with a
regexp. It certainly is. But I don't have time to work out
the details right now, and, considering there's a module
doing what you want to do, I don't have any initiative to
spend time on it.
Abigail | [reply] |