Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Between START .. END

by ioannis (Abbot)
on Sep 14, 2005 at 11:28 UTC ( [id://491823]=note: print w/replies, xml ) Need Help??


in reply to Between START .. END

# if START and END occur only once, we could lock it with m??
while (<DATA>) { next unless my $count = ?start?../end/; next if $count == 1; print; }

Replies are listed 'Best First'.
Re^2: Between START .. END
by softworkz (Monk) on Sep 14, 2005 at 17:00 UTC
    Here's a regex that would do the trick.

    #!/usr/bin/perl -w use strict; while (<DATA>) { $_ =~ tr/!@#$%^&*//d; # will you encounter funky chars? next unless ($_ =~/(^\d+)/); print $_; } __DATA__ START 1 2 3! 4 5 END START 1* 2 3 4 5 6 END

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://491823]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-19 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found