<?xml version="1.0" encoding="windows-1252"?>
<node id="948431" title="Re: Perl Regex Repeating Patterns" created="2012-01-17 17:17:30" updated="2012-01-17 17:17:30">
<type id="11">
note</type>
<author id="699288">
JavaFan</author>
<data>
<field name="doctext">
Untested:
&lt;code&gt;
foreach my $pattern (@patterns) {
    for (my $i = 0; $i &lt; length($string); $i += 3) {
        push @matches, ${^MATCH}
              if substr($string, $i) =~ /^$pattern/p;
    }
}
&lt;/code&gt;
It shouldn't be hard to adapt if you want the offsets (as your original code does). It does capture overlapping matches, although with the given patterns, no overlap is possible.</field>
<field name="root_node">
948417</field>
<field name="parent_node">
948417</field>
</data>
</node>
