Change to upper case
Posted: Thu Sep 13, 2007 5:23 pm
Hi all,
I've searched long and hard through the forum, and can't find anything that addresses this question...forgive me if it's already been asked.
I'd like to use create a replace pattern that converts all letters captured in a referencing group to upper case. Is this possible?
From the Google searches I've done, I've found out about translation, but can't see how it's used unless there's some programming language like PERL or Python behind it.
I'm using a custom built application which is written in Java that has a regex utility in it, so the replace patterns utilize the $1, $2 back referencing notations.
The closest thing I've found from my research is something like:
Search pattern:
/w*
replace pattern:
$0 =~ tr/[a-z]/[A-Z]/;
Test string:
This 1 is a Test
I tried it, but to no avail.
Any help given would be much appreciated.
Thanks!!
I've searched long and hard through the forum, and can't find anything that addresses this question...forgive me if it's already been asked.
I'd like to use create a replace pattern that converts all letters captured in a referencing group to upper case. Is this possible?
From the Google searches I've done, I've found out about translation, but can't see how it's used unless there's some programming language like PERL or Python behind it.
I'm using a custom built application which is written in Java that has a regex utility in it, so the replace patterns utilize the $1, $2 back referencing notations.
The closest thing I've found from my research is something like:
Search pattern:
/w*
replace pattern:
$0 =~ tr/[a-z]/[A-Z]/;
Test string:
This 1 is a Test
I tried it, but to no avail.
Any help given would be much appreciated.
Thanks!!