in reply to Re^2: RegEx question
in thread RegEx question

Are you getting the original data one entry at a time, or are several entries munged together?

The solution is simple if you get the data one entry per line and there is no more than one word for the second label ('Author' in your example). A slight modification of McDarren's sample is what you are after:

use strict; use warnings; my $line = "some text Programming Languages: C++, Java Author: John D +ate Created: 20004-01-05 10:23"; my ($text) = $line =~ / ^[^:]* # Skip everything from the start of line until the first : :\s+ # Skip the : and any trailing white space ( # Capture (?: # Group, but don't capture (?! # look ahead an fail to match if given pattern fou +nd \s+\w+: # Pattern to fail on - space word : ). # Capture a character if the look ahead didn't fai +l )* # Do it as many times as possible ) # Close the capture /x; # x flag ignores most white space and allows comments print $text;

Prints:

C++, Java

DWIM is Perl's answer to Gödel