Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Ant: Regular Expression to get part of filename

Ogroef-OracleMar 29 2014 — edited Apr 3 2014

Hi

I am looking for somebody to help me out to solve my question.  I have a file (XXX_XXX_XXX_XX_YYY.ldt) and I need to select the last part of my filename.  This means that I need the part between the last underscore and the . ?

Example:

File => XXKI_DDR_DERFG_YYY.ldt   ---> From this file I need the YYY.

Can anyone provide me the regular expression for this.

PS: I use ANT from within Netbeans to get this.  I have the ant-contrib library attached to my build file.  This means that I use the PropertyRegex task to analyse my filename.

Kind Regards

Olivier De Groef

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2014
Added on Mar 29 2014
1 comment
2,022 views