I'm currently doing this:
Code:
perl -pe 's/.+\/(.+)/\1/')
Which will replace
with
-- How do I retrieve "myfile.exe" without a replace statement?
For clarification, I have two files, ivy.xml and build.xml.
Ivy.xml line:
Code:
<dependency org="com.project" name="my-service" rev="2.9.1"/>
Build.xml line:
Code:
<unzip src="${ivy.resolved.lib.dir}/my-service-2.9.0.jar" dest="${classes.dir}" />
I am trying to update the build.xml line with the ivy.xml version, so I need to run the following regex:
Code:
my-service\"\ rev=\"(.+)\"
so I can grab \1 as, for example $code, then run:
Code:
perl -p -i -e "s/(.+my-service-)(.+?)(\.jar.+)\.jar.+/\1$code\3/"
on build.xml, thus updating the version.
On a related note, that last perl line doesn't seem like the right way to go about it -- is there a way to match the line, specific to the service, but only update a section thereof?