You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Murray, Mike" <mb...@ptc.com> on 2004/10/15 22:17:56 UTC
pathconvert with regexpmapper
Does anyone have an example of acceptable syntax for using a regexp mapper in a pathconvert?
I've tried many ways, but none work. The documentation says more complex nested mappers are supported. http://ant.apache.org/manual/CoreTasks/pathconvert.html
Thanks, Mike
<!-- strip drive reference - X\:\\ OR X\:/ -->
<mapper id="strip_drive" type="regexp" from=".?\\:[/\\]\\?(.*)$$" to="\1"/>
<pathconvert targetos="unix" property="modroot_location">
<path>
<pathelement location="${modroot}"/>
</path>
<regexpmapper from=".?\\:[/\\]\\?(.*)$$" to="\1"/>
</pathconvert>
<mapper type="regexp" from=".?\\:[/\\]\\?(.*)$$" to="\1"/>
<map type="regexp" from=".?\\:[/\\]\\?(.*)$$" to="\1"/>
<map refid="strip_drive"/>
Re: pathconvert with regexpmapper
Posted by Matt Benson <gu...@yahoo.com>.
Mike: try
<mapper type="regexp"
from="^[A-Z,a-z]:(.*)" to="\1" />
HTH,
Matt
--- "Murray, Mike" <mb...@ptc.com> wrote:
> Does anyone have an example of acceptable syntax for
> using a regexp mapper in a pathconvert?
>
> I've tried many ways, but none work. The
> documentation says more complex nested mappers are
> supported.
>
http://ant.apache.org/manual/CoreTasks/pathconvert.html
>
> Thanks, Mike
>
> <!-- strip drive reference - X\:\\ OR X\:/ -->
> <mapper id="strip_drive" type="regexp"
> from=".?\\:[/\\]\\?(.*)$$" to="\1"/>
>
> <pathconvert targetos="unix"
> property="modroot_location">
> <path>
> <pathelement location="${modroot}"/>
> </path>
> <regexpmapper from=".?\\:[/\\]\\?(.*)$$"
> to="\1"/>
> </pathconvert>
>
> <mapper type="regexp" from=".?\\:[/\\]\\?(.*)$$"
> to="\1"/>
> <map type="regexp" from=".?\\:[/\\]\\?(.*)$$"
> to="\1"/>
> <map refid="strip_drive"/>
>
>
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org