You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mark Modrall <MM...@glgroup.com> on 2006/07/28 16:07:50 UTC

using regexp filters

Hi...

 

            I'm trying to filter the output from an svn update to get
the version number it's up to.  I want to grab just the version number
and output that to a file.  I've been experimenting with <redirector> on
<exec> but I'm running into some odd things (at least from what I can
tell out of the documentation).

 

    <exec executable="svn" outputproperty="upout">

            <arg line="update"/>

            <redirector>

            <outputfilterchain>

                        <linecontains>

                                    <contains value="revision"/>

                        </linecontains>

            </outputfilterchain>

            </redirector>

    </exec>

 

Correctly outputs just the last line which contains the revision number,
but

 

            <linecontainsregexp>

                        <regexp pattern="*revision*"/>

            </linecontainsregexp>

Produces no output.  Seemed odd to me, since the pattern is effectively
the same.

 

            Since ultimately, I also wanted to pick the rev number out
of the string I identified, I experimented with some of the other
filters, like containsstring, containsregexp, replaceregexp.  For
whatever reason, I can't get any regexp to find a match on anything
containing "revision" no matter what I try.  I've also run into some
oddities, like <containsregex> doesn't throw an error when not under
<tokenfilter>; unfortunately it doesn't produce a match either.

 

            Can anyone point me in the right direction to figure out why
regexps aren't hitting for me?

 

            I'm using ant 1.6.5 on windows, by the by.

 

Thanks

-mark

 
This e-mail message, and any attachments, is intended only for the use of the individual or entity identified in the alias address of this message and may contain information that is confidential, privileged and subject to legal restrictions and penalties regarding its unauthorized disclosure and use. Any unauthorized review, copying, disclosure, use or distribution is strictly prohibited. If you have received this e-mail message in error, please notify the sender immediately by reply e-mail and delete this message, and any attachments, from your system. Thank you.

Re: using regexp filters

Posted by Peter Reilly <pe...@gmail.com>.
One needs to use .* for regular expressions.

Peter

On 7/28/06, Mark Modrall <MM...@glgroup.com> wrote:
>
> Hi...
>
>
>
>             I'm trying to filter the output from an svn update to get
> the version number it's up to.  I want to grab just the version number
> and output that to a file.  I've been experimenting with <redirector> on
> <exec> but I'm running into some odd things (at least from what I can
> tell out of the documentation).
>
>
>
>     <exec executable="svn" outputproperty="upout">
>
>             <arg line="update"/>
>
>             <redirector>
>
>             <outputfilterchain>
>
>                         <linecontains>
>
>                                     <contains value="revision"/>
>
>                         </linecontains>
>
>             </outputfilterchain>
>
>             </redirector>
>
>     </exec>
>
>
>
> Correctly outputs just the last line which contains the revision number,
> but
>
>
>
>             <linecontainsregexp>
>
>                         <regexp pattern="*revision*"/>
>
>             </linecontainsregexp>
>
> Produces no output.  Seemed odd to me, since the pattern is effectively
> the same.
>
>
>
>             Since ultimately, I also wanted to pick the rev number out
> of the string I identified, I experimented with some of the other
> filters, like containsstring, containsregexp, replaceregexp.  For
> whatever reason, I can't get any regexp to find a match on anything
> containing "revision" no matter what I try.  I've also run into some
> oddities, like <containsregex> doesn't throw an error when not under
> <tokenfilter>; unfortunately it doesn't produce a match either.
>
>
>
>             Can anyone point me in the right direction to figure out why
> regexps aren't hitting for me?
>
>
>
>             I'm using ant 1.6.5 on windows, by the by.
>
>
>
> Thanks
>
> -mark
>
>
> This e-mail message, and any attachments, is intended only for the use of
> the individual or entity identified in the alias address of this message and
> may contain information that is confidential, privileged and subject to
> legal restrictions and penalties regarding its unauthorized disclosure and
> use. Any unauthorized review, copying, disclosure, use or distribution is
> strictly prohibited. If you have received this e-mail message in error,
> please notify the sender immediately by reply e-mail and delete this
> message, and any attachments, from your system. Thank you.
>
>