Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: pdi regular expression if else scenario (or capture groups)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2014
    Posts
    29

    Unhappy pdi regular expression (if else scenario -capture groups)

    Hi folks,

    I am trying to get the datetime part from a list of files

    names can be like given below :

    a_b_c_02022018122555.txt
    a_b_c_02_2345_02022018122555_123.txt
    abc02022019122555.txt
    abc_pqr_02022019.txt
    abc_pqr_02022019_123.txt

    I need a common regex to retrieve output as follows . Basically this is equivalent to getting if(14digit_timestamp) then (get 14digit_timestamp) else (8digit_timestamp). I was trying something like (.*)([0-9]{14})[0-9]{14}|[0-9]{8}.* and cant make it work..
    02022018122555
    02022018122555
    02022019122555
    02022019
    02022019
    Last edited by pdiman; 05-03-2018 at 06:06 PM.
    Best,
    Abin

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.