in reply to Re: RegEx Problem
in thread RegEx Problem

I'm currently using:
$moo = 'boo-hoo-hoo'; $hoo = lcfirst join '', map { ucfirst $_ } split /-/, $moo;
To do that exact reverse of the above... is there a better way (I'm sure there is)?

Replies are listed 'Best First'.
Re: Re: Re: RegEx Problem
by lestrrat (Deacon) on May 29, 2002 at 01:08 UTC

    Ah, I should be able to redeem myself on this one...

    $str =~ s/-([a-z])/uc $1/ge;

    /me crosses fingers

    Update: Oh dang. Damn you, Kanji ;)

      I prefer to save /e for more complex substitutions, as \u (\l's counterpart) will do the same job...

      s/-([a-z])/\u$1/g;

          --k.