Table of Contents

Search

  1. Preface
  2. Introduction to Dynamic Data Masking
  3. Rules
  4. Connection Rules
  5. Security Rules
  6. Security Rule Set Simulator
  7. Masking Functions
  8. Stored Procedure Result Set Masking
  9. Integration with Informatica Products
  10. XML Functions Reference
  11. Glossary

Sample Expressions

Sample Expressions

To identify strings of text in an incoming SQL request, define regular expression character literals and metacharacters in the Text matcher.
The following table provides examples of regular expressions:
Regular Expression Matching
SQL Text
Description
invoice \.number
or
sqlplus\.exe
SELECT invoice.number FROM invoices
The
\.
expression defines a period. The period matches any character. The backslash before the period character removes the value of the following character in regular expression.
.*(customers)\s+.*
SELECT customers FROM dual
The pattern matches statements with the text string
customers
. The expression
.*
indicates that any text can appear before the text string
customers
. The expression
\s+
after
customers
indicates that there must be one or more spaces. The expression
.*
indidcates that any text can follow the spaces.
.*\s+(cust)+\s+.*
SELECT CustCustcust FROM dual
The pattern matches text strings with one or more
cust
texts.
.*WHERE.*(\W+TR\w*\s*)((=\s*')|(IN)|(between)|(>)|(,\s*')|(<)|(=\s*DMN_TABLE)).*
SELECT * FROM dual WHERE tr = 'sdf
The pattern matches text strings that use nonword characters. A nonword character does not use [a-zA-Z_0-9]). The pattern defines
\W
followed by
TR
and any number of characters or spaces
\w*\s*
.
create\s+or\s+replace\s+view\s+C\$_C100008J13\s+\s+As\s+select\s+(.*)From\s+OA.S_CAMP_CON\s+S_C,\s+OA.S_ORG_EXT\s+S_O,\s+OA.S_ORG_EXT_X\s+Where\s+(.*)
CREATE or REPLACE VIEW C$_C100008J13 AS SELECT a, b, c, d, e, f FROM OA.S_CAMP_CON S_C, OA.S_ORG_EXT S_O, OA.S_ORG_EXT_X WHERE a=b and c = d
The regular expression uses
\s+
to identify one or more spaces or the end of line in the original statement. The expression
C\$_C100008J13\
changes to
C$_C100008J13
because the dollar sign is a special sign in regular expression. If you do not want to use the regular expression version of the dollar sign, you must use the backslash character before the dollar sign.