Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Help!! Regular Expressions

by bjelli (Pilgrim)
on Apr 12, 2001 at 14:13 UTC ( #72006=note: print w/replies, xml ) Need Help??

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://72006]
[Corion]: Meh - anybody signed into Github? A wild spammer has appeared.
[Corion]: Otherwise, I'll open a ticket to get them killed in the evening

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2017-08-24 07:41 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (365 votes). Check out past polls.