• 1-5 of 5
  • Ratheesh Rathinavel

    Thanks MB

  • Ratheesh Rathinavel

    Hi MB,

    When we are trying to achive custom masking for the above requirement, through Process designer with PHP code, we are getting an error saying 'PHP file does not contain a header'. Below is the code that we are using in PHP file.

    Can any one throw some light, to eliminate this error.



    $stringToreplace = "Hi my name is Alan. And here i have listed my numbers 12345678901234567, 123456789012345678, 1234567890123456789, 8767 and 123123123123123123123";

    preg_match_all('/(?<!\d)(\d{17}|\d{18}|\d{19})(?!\d)/', $stringToreplace, $matches);
    //Above code will get the matches
     $mF = $matches[0];
     foreach ($mF as $matched)
     $len = strlen($matched);
        $maskedString =  str_repeat('X',$len - 2) . substr($matched, $len - 4 ,4);
      $stringToreplace = str_replace($matched, $maskedString , $stringToreplace);
     echo $stringToreplace;


  • Ratheesh Rathinavel

    Hi MB,


    We have tried masking 19 digit number through custom masking feature using expression -  [0-9]{4}[0-9]{4}[0-9]{4}[0-9]{3}.

    We are able to mask first 15 digits and display the last 4 digits as in attached screenshot for reference.

    We are able to achieve this for diferent types numbers with 16, 17, 18, 19 digits individually. But we are not able to group the conditions for all the required 15 to 19 digits length numbers, and mask them dynamically, leaving last 4 digits. We would like to have this conditions achieved in one RegEx experession. Hence we are checking with the forum.


    R. Ratheesh


  • Ratheesh Rathinavel

    Hi MB,

    Thanks for the info.

    I tried with both the expressions "^[0-9]{15,19}$" and "[[:<:]][0-9]{15,19}[[:>:]]". They are working and mask the entire set of numbers. But our requirement is to mask the numbers except for the last 4 digits. something like this;

    123456789012345 should be masked as XXXXXXXXXXX2345

    1234567890123456 should be masked as XXXXXXXXXXXX3456

    12345678901234567 should be masked as XXXXXXXXXXXXX4567

    123456789012345678 should be masked as XXXXXXXXXXXXXX5678

    1234567890123456789 should be masked as XXXXXXXXXXXXXXX6789

    Please suggest.


    R. Ratheesh

  • Ratheesh Rathinavel


    Thanks for your reply.

    I am using the "Incident Thread Masking" feature and trying to add an expression in the custom Mask 1. I had tried something expressions like,


    But it is not exactly masking as we require. Hence i am looking if some one have already worked on similar requirement, so that take a help in constructing the expression