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

Re: Match all Non-0 and Letters

by AnomalousMonk (Archbishop)
on Jun 24, 2017 at 08:16 UTC ( [id://1193436]=note: print w/replies, xml ) Need Help??


in reply to Match all Non-0 and Letters

It's not clear to me just what you want. If you want to extract from a line all "normal" words skipping other words, try something like this:

c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "my $normal = qr{ 0{7} [0-9] }xms; ;; my $line = '00000000 FFFFFFFF 00000001 6C163512 00000002 ' . 'ffffffff 00000003 0000009 00000004 000000009 ' . '0 00 000 0000 00000 000000 0000000 000000000 ' . '00000005' ; print qq{line: '$line'}; ;; my @all_ok = $line =~ m{ \b $normal \b }xmsg; dd \@all_ok; " line: '00000000 FFFFFFFF 00000001 6C163512 00000002 ffffffff 00000003 +0000009 00000004 000000009 0 00 000 0000 00000 000000 0000000 0000000 +00 00000005' [ "00000000", "00000001", "00000002", "00000003", "00000004", "00000005", ]


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-24 02:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found