Ant Tokenizer: Selecting an individual Token

Posted by John Oxley on Stack Overflow See other posts from Stack Overflow or by John Oxley
Published on 2010-03-05T08:38:57Z Indexed on 2010/03/09 6:51 UTC
Read the original article Hit count: 244

Filed under:
|
|

I have the following ant task:

<loadfile property="proj.version" srcfile="build.py">
    <filterchain>
        <striplinecomments>
            <comment value="#"/>
        </striplinecomments>
        <linecontains>
            <contains value="Version" />
        </linecontains>
    </filterchain>
</loadfile>
<echo message="${proj.version}" />

And the output is

 [echo] config ["Version"]          = "v1.0.10-r4.2"

How do I then use a tokenizer to get only v1.0.10-r4.2, the equivalent of

| cut -d'"' -f4

© Stack Overflow or respective owner

Related posts about ant

Related posts about java