olczyk / interaccess.com (Thaddeus L. Olczyk) writes:

[rude, thankless rant snipped]

In your original post, only the subject implied (not stated, but implied)
that you wanted to use each_byte. You stated in the first paragraph, "I am
interested in the general technique". I took that as a request for a
different approach. At the end of your request for help you used two
examples that don't even use each_byte.

Later you wrote,

"The main parts that I am having problem with are:
1) Character matching.
2) Character manipulation."

Our answers were well-intentioned. Your response to our offers of help is
to call them "a set of hacks which together solve the problem." You stated
that our answeres [sic] used a "wizards mentality of avoiding understanding
how the language handles certain things."

Very rude.

> In any case I now present a version of the problem where the basics
> almost have to be handled.

What the heck does "the basics almost have to be handled" mean? I can not
understand what you are trying to say.

> Given a string I want a function to produce a string that replaces the
> characters by the following rule.
> 1) If the character is lower-case, I want it replaced by \x followed
> by the hex value.
> 2) If the character is upper-case, I want it replaced by \ followed
> by the octal represntation.
> 3) If the character is a digit I want it replaced by \b followed by
> the binary representation.
> 4) If the character is otherwise printable I want it replaced by \d
> followed by the base ten representation.
> 5) If the character is notpritable I want it replaced by \4 and the
> base four representation.

This is, of course, a completely different specification from your original
article. After completing your original homework assignment for you, I see
no need to write this one.

> For the truely intelligent who try this, thanks.

Does one have to know how to spell to be "truely" intelligent? (Geez, I
haven't stooped as low as a spelling flame in a long time.) I have
killfiled only one person in my twenty years of Usenet reading. Not that
you care, but you may be the second.

Jim
-- 
Jim Menard, jimm / io.com, http://www.io.com/~jimm/
"Brought to you again by the Department of Redundancy Department."
    -- Firesign Theatre