<?xml version="1.0" encoding="windows-1252"?>
<node id="985286" title="Re^2: regular expression" created="2012-08-03 12:51:58" updated="2012-08-03 12:51:58">
<type id="11">
note</type>
<author id="509638">
pileofrogs</author>
<data>
<field name="doctext">
&lt;p&gt;Woah!&lt;/p&gt;
&lt;p&gt;That works.  I expected it would fail because the first group would match everything and then there would be nothing for the 2nd group to match against.&lt;/p&gt;
&lt;p&gt;Here's the code I used to test:&lt;/p&gt;
&lt;code&gt;
#! /usr/bin/perl -w -T

use strict;

my $str = 'foo_bar_foo_bar_12345';

print "$str\n";
$str =~ /(.*)(\1.*)/ || die "Failed!\n";
print "$2\n"; 
&lt;/code&gt;

&lt;p&gt;Can anyone explaine why that is?&lt;/p&gt;</field>
<field name="root_node">
985249</field>
<field name="parent_node">
985255</field>
</data>
</node>
