Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Match all Non-0 and Letters

by Athanasius (Archbishop)
on Jun 24, 2017 at 07:23 UTC ( [id://1193435]=note: print w/replies, xml ) Need Help??


in reply to Match all Non-0 and Letters

Hello arblargan, and welcome to the Monastery!

Assuming your “words” are separated by whitespace within each line, the following should do what you want:

use strict; use warnings; OUTER: while (my $line = <DATA>) { my @words = split /\s+/, $line; for (@words) { next OUTER unless /^0{7}\d$/; } print $line; } __DATA__ 00000000 00000001 00000009 00000006 FFFFFFFF 00000007 6C163512 00000000 00000008 00000003 00000004 01020102

Output:

17:21 >perl 1786_SoPW.pl 00000000 00000001 00000009 17:22 >

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

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

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

    No recent polls found