If you have a path written in a file, and you’d like to get a basename from it, like in the following example:
/this/is/my/path.txt
after you run this target, you will have only path.txt. Here’s the code that makes that possible:
<target name="rgx" description="basename equivalent">
<replaceregexp file="a.txt" match="(.*/)|(.*\\)" replace="" byline="true"/>
</target>