Topic
  • 4 replies
  • Latest Post - ‏2014-07-18T04:49:22Z by Saurabh.Shukla
Saurabh.Shukla
Saurabh.Shukla
17 Posts

Pinned topic Data Masking in Oracle on Particular Pattern

‏2014-05-13T05:46:44Z |

Hi everybody ,

I am using Guardium version 9.0 and I want to mask a data in my table

Eg :  Mobile Number which is of 10 digits , so I want a particular regular expression for this so that only this pattern is masked ,say i have another column of 12 digits so it will not mask that column.

I am using below regular expression for masking the 10 digit Mobile Number Column

^([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9]$

and it is not working.

But if i use the above regular expression like this ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9] masking is happening on Mobile Number Column as well as 12 digit column which i do not want to.

Kindly specify the regular expression for this issue of 10 Digits.

Updated on 2014-07-16T09:03:58Z at 2014-07-16T09:03:58Z by Saurabh.Shukla
  • 4BV7_Joann_Ruvolo
    4BV7_Joann_Ruvolo
    1 Post

    Re: Data Masking in Oracle on Particular Pattern

    ‏2014-05-14T05:41:52Z  

    Hi,

    In v9 the anchor characters (^ and $) are not supported by the regex package used in the sniffer. You can try the following regex to match a 10 digit number, but not a 12 digit number. Essentially, it matches a 10 digit number and up to 2 optional blanks.

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9][ ]{0,2}

  • Saurabh.Shukla
    Saurabh.Shukla
    17 Posts

    Re: Data Masking in Oracle on Particular Pattern

    ‏2014-05-14T06:58:27Z  

    Hi,

    In v9 the anchor characters (^ and $) are not supported by the regex package used in the sniffer. You can try the following regex to match a 10 digit number, but not a 12 digit number. Essentially, it matches a 10 digit number and up to 2 optional blanks.

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9][ ]{0,2}

    Hi,

     

    Thanks for the reply but this is also not working. Besides that we have also tried

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9]\s*

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9]\s+

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9]\s?

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9][^0-9]

    None of them is providing the required output

    Can you please tell me the purpose of sql pattern field mention just below the DATA pattern.

     

    Regards

    Updated on 2014-05-14T07:12:14Z at 2014-05-14T07:12:14Z by Saurabh.Shukla
  • rev1
    rev1
    41 Posts

    Re: Data Masking in Oracle on Particular Pattern

    ‏2014-07-15T20:07:31Z  

    Hi,

     

    Thanks for the reply but this is also not working. Besides that we have also tried

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9]\s*

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9]\s+

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9]\s?

    ([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])[0-9][0-9][^0-9]

    None of them is providing the required output

    Can you please tell me the purpose of sql pattern field mention just below the DATA pattern.

     

    Regards

    if it store in below format you can using below regular expression

    ([0-9]{-[0-9]{3}3})-[0-9]{4}

  • Saurabh.Shukla
    Saurabh.Shukla
    17 Posts

    Re: Data Masking in Oracle on Particular Pattern

    ‏2014-07-18T04:49:22Z  
    • rev1
    • ‏2014-07-15T20:07:31Z

    if it store in below format you can using below regular expression

    ([0-9]{-[0-9]{3}3})-[0-9]{4}

    Hi rev1,

    Thanks for regular expression ,but this regular expression giving me error when i use in Extrusion rule in Data Pattern column and give it a check it says Syntax Error: Illegal repetition near index 5
    ([0-9]{-[0-9]{3}3})-[0-9]{4} if i have to mask a ten digit number in a column .

    Regards