I am trying to extract the directory and file name from a path. I have got it working with normal file names that only have a single dot as part of the extension name, but it fails to work if there are multiple dot's in the file name.
Normal case results in:
Web Content/javascript/more/andmore/evenmore AND uidoublerebel
I am wanting it to also handle a file name like:
ui.effects.core-1.7-doublerebel.js
results in:
Web Content/javascript/more/andmore/evenmore AND ui.effects.core-1.7-doublerebel
Can anyone help with the regular expression I have.
${content.dir.unix}/([^.])/([^.]).((css)|(js))$
<property name="content.dir.path" value="C:/ajm/zip/jdw-content"/>
<property name="file.name.problem" value="C:/ajm/zip/jdw-content/Web Content/javascript/ore/andmore/evenmore/ui.effects.core-1.7-doublerebel.js"/>
<property name="file.name.works" value="C:/ajm/zip/jdw-content/Web Content/javascript/more/andmore/evenmore/uidoublerebel.js"/>
<propertyregex override="yes"
property="zip.dir.structure" input="${file.name.problem}"
regexp="${content.dir.unix}/([^\.]*)/([^\.]*)\.((css)|(js))$" replace="\1 AND \2"/>
<echo> messge = ${zip.dir.structure}</echo>
Thanks
Andy