Lana has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks!
I am working on parsing text and making required substitutions inside it. For example, I have a template text and I am using curly braces inside it in places where text may vary depending on input data:
text text {scope 4 text {scope 2 text {scope 1 text} scope 2 text} scope 4 text {scope 3 text} scope 4 text } text textThe question is how to process the scopes, subscopes in the order I stated in the example sentence? 1-2-3-4? I mean accessing the most inner one and then moving to the top (most outer) scope.
What is the best way to do that?
Thanks! Lana :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text parsing. Processing scopes and subscopes.
by 1nickt (Canon) on Aug 25, 2015 at 22:50 UTC | |
by shawnhcorey (Friar) on Aug 26, 2015 at 12:54 UTC | |
|
Re: Text parsing. Processing scopes and subscopes.
by BrowserUk (Patriarch) on Aug 25, 2015 at 23:41 UTC | |
|
Re: Text parsing. Processing scopes and subscopes.
by Anonymous Monk on Aug 26, 2015 at 04:38 UTC | |
|
Re: Text parsing. Processing scopes and subscopes.
by graff (Chancellor) on Aug 27, 2015 at 02:04 UTC | |
|
Re: Text parsing. Processing scopes and subscopes.
by nuance (Hermit) on Aug 26, 2015 at 13:35 UTC | |
|
Re: Text parsing. Processing scopes and subscopes.
by locked_user sundialsvc4 (Abbot) on Aug 26, 2015 at 04:19 UTC |