<?xml version="1.0" encoding="windows-1252"?>
<node id="1017160" title="Re: RegEx - Positive Look-ahead" created="2013-02-05 08:39:11" updated="2013-02-05 08:39:11">
<type id="11">
note</type>
<author id="647953">
sundialsvc4</author>
<data>
<field name="doctext">
&lt;p&gt;
To me, this is the sort of problem that should be described in terms of a &lt;em&gt;grammar,&lt;/em&gt; and then handled using [mod://Parse::RecDescent]. &amp;nbsp; (I have used that module quite extensively and it works very well.)
&lt;/p&gt;&lt;p&gt;
Let me give you one small tip if you go that way... &amp;nbsp; Part of your code will consist of the grammar and Perl code that will be compiled on-the-fly into it. &amp;nbsp; This is a great place to put a &lt;tt&gt;use&lt;/tt&gt; statement(s) that will link to any subroutines that you find that you need to make use of in the grammar code.
&lt;/p&gt;&lt;p&gt;
Anyway, the advantage of this approach is that you describe the structure of the language being processed and let the parser do the magic. &amp;nbsp; It takes a bit of practice to get the grammar right, heh, but the &lt;em&gt;parser&lt;/em&gt; can handle the mechanics of regex&amp;rsquo;ing and backtracking so that your code doesn&amp;rsquo;t have to. &amp;nbsp; You can extend it to do more things without getting buried.
&lt;/p&gt;
</field>
<field name="root_node">
1017155</field>
<field name="parent_node">
1017155</field>
</data>
</node>
