in reply to Regular expression to match text between two tags (was: Help!! Regular Expressions)

another solution, without regular expressions. I assumed that you're reading from a file, and that you want to read in more the one lump of data:

#!/usr/bin/perl -w use strict; { local $/ = ":::"; # read stuff separated by ::: while(<DATA>) { s/:::$//; # remove the ::: at the end of # each lump of data print "found a piece -->$_<--\n\n"; } } __DATA__ Some foo:::This is a some text. It talks about CGI::Carp, but then suddenly changes subject to matching three :'s in a row ::: The server asked you what permission you had to tell it what to do on it's day off. This was your day.::: More foo.

hope that helps

--
Brigitte    'I never met a chocolate I didnt like'    Jellinek
http://www.horus.com/~bjelli/         http://perlwelt.horus.at