Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
AW: propertyregex: capitalizing entire string

AW: propertyregex: capitalizing entire string

2005-05-10       - By Jan.Materne@(protected)

You can use <script>, starting at [1].


Jan

[1] http://marc.theaimsgroup.com/?l=ant-user&m=108988637506114&w=2


> -----Urspr?ngliche Nachricht-----
> Von: Holger Rauch [mailto:holger.rauch@(protected)]
> Gesendet am: Dienstag, 10. Mai 2005 11:11
> An: user@(protected)
> Betreff: propertyregex: capitalizing entire string
>
> Hi!
>
> I'm trying to capitalize a string as demonstrated with the
> following small
> sample build file:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <project name="test" basedir="." default="main">
>     <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
>     <target name="main">
>         <property name="foo" value="blah/blubber/foo"/>
>         <propertyregex property="FOO" input="${foo}" regexp="[a-z]"
> replace="[A-Z]" global="true"/>
>         <echo>foo = ${foo}</echo>
>         <echo>FOO = ${FOO}</echo>
>     </target>
> </project>
>
> The output I get however is that each lowercase letter is converted
> literally to "[A-Z]":
>
> main:
>      [echo] foo = blah/blubber/foo
>      [echo] FOO =
> [A-Z][A-Z][A-Z][A-Z]/[A-Z][A-Z][A-Z][A-Z][A-Z][A-Z][A-Z]/[A-Z]
> [A-Z][A-Z]
>
> Is case conversion possible with the propertyregex task from
> ant-contrib? If
> so, which adjustments do I have to make?
>
> Any help is greatly appreciated!
>
> Greetings,
>
>   Holger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.