in reply to Re: Regexp matched part to lower case
in thread Regexp matched part to lower case

You think like this? $string =~ s/{\@see\s+((\w+\.)+)(\w+)#(\w+)}/<idl package="lc($1)" name="$3" anker="$4"/>/eg; But that's not working ;-)
  • Comment on Re^2: Regexp matched part to lower case

Replies are listed 'Best First'.
Re^3: Regexp matched part to lower case
by ivancho (Hermit) on Jun 02, 2005 at 07:18 UTC
    the right hand side will be evaluated. Thus, treat it not as surrounded by quotes, but as an expression.

    like:

    s/.../"<idl package=\"".lc($1)."\" name=\"$3\" anker=\"$4\"\/>"/ge

    Update: sorry, forgot the "'s

Re^3: Regexp matched part to lower case
by prasadbabu (Prior) on Jun 02, 2005 at 07:21 UTC

    Here \ is a special character before @ so you have to escape it by \\.

    Then do slight change in replacement part.

    /"<idl package=\"".lc($1)."\" name=\"$3\" anker=\"$4\"\/>"/esi;

    updated

    Prasad