Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6959477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:16:37+00:00 2026-05-27T15:16:37+00:00

I’m attempting to use a property as a template for multiple other properties, but

  • 0

I’m attempting to use a property as a template for multiple other properties, but it only works the first time. It’s probably easiest to show by example, so I’ve cut down my code to a minimal case that exhibits this behaviour:

<target name="test">
    <property name="individual.template" value="x@ID@"/>

    <propertyregex property="individual.1" input="${individual.template}" regexp="\@ID\@" replace="1" global="true" override="true"/>
    <echo>====== ${individual.1} ::: ${individual.template}</echo>
    <propertyregex property="individual.2" input="${individial.template}" regexp="\@ID\@" replace="2" global="true" override="true"/>
    <echo>====== ${individual.2} ::: ${individual.template}</echo>
    <propertyregex property="individual.3" input="${individial.template}" regexp="\@ID\@" replace="3" global="true" override="true"/>
    <echo>====== ${individual.3} ::: ${individual.template}</echo>
    <propertyregex property="individual.4" input="${individial.template}" regexp="\@ID\@" replace="4" global="true" override="true"/>
    <echo>====== ${individual.4} ::: ${individual.template}</echo>
    <propertyregex property="individual.5" input="${individial.template}" regexp="\@ID\@" replace="5" global="true" override="true"/>
    <echo>====== ${individual.5} ::: ${individual.template}</echo>
</target>

I would expect this to output x1, x2, etc., but it outputs the following:

 [echo] ====== x1 ::: x@ID@
 [echo] ====== ${individual.2} ::: x@ID@
 [echo] ====== ${individual.3} ::: x@ID@
 [echo] ====== ${individual.4} ::: x@ID@
 [echo] ====== ${individual.5} ::: x@ID@

As you can see it’s ok for the first one, but the next properties are simply not set. I thought at first that the template property was modified, but as you can see from the output, that’s not the case. Am I just doing something silly here? Is this not supported? Or is it a bug? Any ideas would be greatly appreciated.

(Ant version 1.8.2, ant-contrib version 1.0b2).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:16:38+00:00Added an answer on May 27, 2026 at 3:16 pm

    @thor84no, I see a copy/paste error in the test case: Shouldn’t you be printing the value of individual.1/individual.2/individual.3/individual.4/individual.5 instead of individual.template? I made these changes locally and the output is what you had expected:

    test:
         [echo] ====== x1 ::: x1
         [echo] ====== x2 ::: x2
         [echo] ====== x3 ::: x3
         [echo] ====== x4 ::: x4
         [echo] ====== x5 ::: x5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.