title: Better way to write this regex to match multi-ordered property list?
body: <p>I've been whacking on this regex for a while, trying to build something that can pick out multiple ordered property values (DTSTART, DTEND, SUMMARY) from an .ics file.  I have other options (like reading one line at a time and scanning), but wanted to build a single regex that can handle the whole thing.</p>
  
  <h2>SAMPLE PERL</h2>
  
  <pre><code># There has got to be a better way...
  my $x1 = '(?:^DTSTART[^\:]*:(?&lt;dts&gt;.*?)$)';
  my $x2 = '(?:^DTEND[^\:]*:(?&lt;dte&gt;.*?)$)';
  my $x3 = '(?:^SUMMARY[^\:]*:(?&lt;dtn&gt;.*?)$)';
  my $fmt = "$x1.*$x2.*$x3|$x1.*$x3.*$x2|$x2.*$x1.*$x3|$x2.*$x3.*$x1|$x3.*$x1.*$x2|$x3.*$x2.*$x1";
  
  if ($evts[1] =~ /$fmt/smo) {
  printf "lines:\n==&gt;\n%s\n==&gt;\n%s\n==&gt;\n%s\n", $+{dts}, $+{dte}, $+{dtn};
  } else {
  print "Failed.\n";
  }
  </code></pre>
  
  <h2>SAMPLE DATA</h2>
  
  <p>BEGIN:VEVENT<br>
  UID:0A5ECBC3-CAFB-4CCE-91E3-247DF6C6652A<br>
  TRANSP:OPAQUE<br>
  SUMMARY:Gandalf_flinger1<br>
  DTEND:20071127T170005<br>
  DTSTART,lang=en_us:20071127T103000<br>
  DTSTAMP:20100325T003424Z<br>
  X-APPLE-EWS-BUSYSTATUS:BUSY<br>
  SEQUENCE:0<br>
  END:VEVENT  </p>
  
  <h2>SAMPLE OUTPUT</h2>
  
  <p>lines:<br>
  ==><br>
  20071127T103000<br>
  ==><br>
  20071127T170005<br>
  ==><br>
  Gandalf_flinger1  </p>