[Techtalk] Regular Expression Question

Kai MacTane kmactane at GothPunk.com
Mon Oct 1 15:13:00 EST 2001

At 10/1/01 02:44 PM , Bowen, Tricia wrote:
>Does anyone have a quick and dirty way of translating:
>MY_TABLE_NAME to MyTableName
>I know tr/[A-Z]/[a-z]/ will do half the job, but I
>need a way to make something like this
>s/(_.)/($1 =~ tr/[a-z]/[A-Z/)/; work.

Does it have to be a one-liner? Does it have to be a general regex, or can 
it be expressed in Perl? I think I have something like this sitting around 
somewhere, but it may be two or even three lines. (If that's okay.)

(I sometimes like to keep things multi-line, just for readability. And also 
to combat Perl's reputation as a write-only language.)

Anyway, I can work on finding it while you answer and let me know if it 
would even work for you.

                                                 --Kai MacTane
"Deadly angels for reality and passion..."
                                                  "Gunning for the

More information about the Techtalk mailing list