Thursday, 12 September 2013

Regex substitution with Notepad++

Regex substitution with Notepad++

I have a text file with several lines like these ones:
cd_cod_bus
nm_number_ex
cd_goal
And I want to get rid of the - and uppercase the following character using
Notepad++ (I can also use other tool but if it doesn't get the problem
more troublesome).
So I tried to get the characters with the following regex (?<=_)\w and
replace it using \U\1\E\2 for the uppercasing trick but here is where my
problems came. I think the regex is OK but once I click replace all I get
this result:
cd_od_us
nm_umber_x
cd_oal
as you can see it is only deleting the match.
Do you know where the problem is?
Thanks.

No comments:

Post a Comment