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

Re: Match all Non-0 and Letters

by anonymized user 468275 (Curate)
on Jun 25, 2017 at 07:15 UTC ( [id://1193488]=note: print w/replies, xml ) Need Help??


in reply to Match all Non-0 and Letters

Sorry for being the wicked witch arriving late at what looks like a decimal-only gabberfest, but I could not help smiling at the term 'corruption' - apparently just because the data is hexadecimal rather than decimal. Or to put it another way, are you sure you should be filtering out the hex rather than taking it at face value?

What about just converting it to decimal instead, e.g. see https://perldoc.perl.org/functions/hex.html

Update: If you want to limit the data to a range of values, you should STILL convert from hex to decimal first and then apply the test. In other words just forget the idea that fffffff is corrupt because e.g. 0000000A is only 10 in decimal - quite a low value and you might want to include the value 10!

One world, one people

Replies are listed 'Best First'.
Re^2: Match all Non-0 and Letters
by haukex (Archbishop) on Jun 26, 2017 at 17:58 UTC
    'corruption' - apparently just because the data is hexadecimal rather than decimal

    I think the OP was quite specific in the definition of the input format - "a normal word will be 7 0's followed by a number between 0-9 (8-digits total)". To put some perspective on this from an ECE point of view, I find this kind of corruption is completely "normal", for example, in a RS-232 or wireless serial data stream corrupted by noise. Simply skipping the obviously corrupted values until a good value is seen is a valid approach to regaining synchronization with the stream. Of course there are ways to add error detection and/or correction encodings on the stream on the transmitting end so the corruption is less likely in the first place, but a large number of "modern" devices I've worked with still don't do this.

    A reply falls below the community's threshold of quality. You may see it by logging in.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2024-04-18 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found