N
natG
Hi;
I have followed the "greedy backwards" thread and it is over my head,
and I do not know if the solution there applies to this problem.
I'd like to find the *last* occurrence of a string (usually one
character) within a target (equivalent to string.lastindexof in Java),
and uppercase it. This, using Ant, hence I need a vanilla Regex solution.
Although at the very moment I need it to get the last dir of a path name
(and uppercase it), at a generic level, I find 'find backwards via
regex' extremely useful. So, if the solution can be a bit generic, it
would be great. But, again, at the moment, I want a regex to get 'dirc'
out of "dira/dirb/dirc" and uppercase it, so the final string is 'Dirc'.
(And although Ant has a 'basedir' tag, it [correctly ]does not uppercase
it.)
Tia
-nat
I have followed the "greedy backwards" thread and it is over my head,
and I do not know if the solution there applies to this problem.
I'd like to find the *last* occurrence of a string (usually one
character) within a target (equivalent to string.lastindexof in Java),
and uppercase it. This, using Ant, hence I need a vanilla Regex solution.
Although at the very moment I need it to get the last dir of a path name
(and uppercase it), at a generic level, I find 'find backwards via
regex' extremely useful. So, if the solution can be a bit generic, it
would be great. But, again, at the moment, I want a regex to get 'dirc'
out of "dira/dirb/dirc" and uppercase it, so the final string is 'Dirc'.
(And although Ant has a 'basedir' tag, it [correctly ]does not uppercase
it.)
Tia
-nat