IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Regex to replace the file with date

  • 1.  Regex to replace the file with date

    Posted Wed September 19, 2018 03:02 PM

    Hi team,

    I would like to rename a file .extension to _date.extension.
    I am able to do .filename.extension.
    I am using the pub.string:replace service.
    Please help with the regex to do it or any other method to do it.
    Waiting for answer from dev gurus…


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Regex to replace the file with date

    Posted Thu September 20, 2018 02:50 AM

    Assuming the File name is filename.extension and you want to achieve filename_date.extension

    SearchString: .
    replaceString: $1_%date%.$2
    useRegex: true

    $1 will be the filename
    $2 is the extension
    %date% is the value for the variable date.

    HTH
    Radhika


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB