/policyengine/v1/regex: GET

Retrieves list of all the regular expressions registered in the Data Cataloging system.

The following table shows roles that can perform read operation on the endpoint:
Table 1. Access by role
Data admin Data user Collection Admin Admin Service user
Χ Χ

Synopsis of the request URL

curl -k -H 'Authorization: Bearer <token>' https://$SDHOST/policyengine/v1/regex -X GET -H ’Accept: application/json’

Supported request types and response formats

Supported request types:
  • GET
Supported response formats:
  • JSON

Examples

The following example returns all the regular expressions registered for which you have read permission.
  1. Issue the following request in one line.
    curl -k -H "Authorization: Bearer ${TOKEN}" https://$SDHOST/policyengine/v1/regex -X GET
  2. The following response is returned.
    200(OK)
    
    [
      {
        "regex_id": "EmailID",
        "pattern": "\\b[\\w\\.=-]+@[\\w\\.-]+\\.[\\w]{2,3}\\b",
        "description": "Matching Email IDs like : John.Smith@example.com"
      },
      {
        "regex_id": "US-SSN",
        "pattern": "\\b\\d{3}-\\d{2}-\\d{4}\\b",
        "description": "Matching United States Social Security Numbers (SSN) like: 513-84-7329"
      },
      {
        "regex_id": "IPV4-Address",
        "pattern": "\\b\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}\\b",
        "description": "Matching IPV4 address like: 192.168.1.1"
      },
      {
        "regex_id": "Dates-MM/DD/YYYY",
        "pattern": "\\b(((0)[0-9])|((1)[0-2]))(\\/)([0-2][0-9]|(3)[0-1])(\\/)\\d{4}\\b",
        "description": "Matching dates in MM/DD/YYYY format like: 05/21/2019"
      },
      {
        "regex_id": "Dates-DD/MM/YYYY",
        "pattern": "\\b([0-2][0-9]|(3)[0-1])(\\/)(((0)[0-9])|((1)[0-2]))(\\/)\\d{4}\\b",
        "description": "Matching dates in DD/MM/YYYY format like: 15/10/2019"
      },
      {
        "regex_id": "MasterCard",
        "pattern": "\\b(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01]
                    [0-9]|2720)[0-9]{12}\\b",
        "description": "Matching MasterCard number like: 5258704108753590"
      },
      {
        "regex_id": "VisaCard",
        "pattern": "\\b([4]\\d{3}[\\s]\\d{4}[\\s]\\d{4}[\\s]\\d{4}|[4]\\d{3}[-]\\d{4}[-]\\d{4}[-]
                    \\d{4}|[4]\\d{3}[.]\\d{4}[.]\\d{4}[.]\\d{4}|[4]\\d{3}\\d{4}\\d{4}\\d{4})\\b",
        "description": "Matching Visa Card numbers like: 4563-7568-5698-4587"
      },
      {
        "regex_id": "AmexCard",
        "pattern": "\\b3[47][0-9]{13}\\b",
        "description": "Matching American Express Card numbers like: 340000000000009"
      },
      {
        "regex_id": "USZIPCode",
        "pattern": "\\b((\\d{5}-\\d{4})|(\\d{5})|([A-Z]\\d[A-Z]\\s\\d[A-Z]\\d))\\b",
        "description": "Matching United States ZIP codes like: 97589"
      },
      {
        "regex_id": "URL",
        "pattern": "\\b((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)
                    ([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?\\b",
        "description": "Matching URLs like: http://www.test.com/dir
                        /filename.jpg?var1=foo#bar&var2=val2"
      },
      {
        "regex_id": "Geo-Coordinate",
        "pattern": "\\b([-+]?)([\\d]{1,2})(((.)(\\d+)(,)))(\\s*)(([-+]?)
                    ([\\d]{1,3})((.)(\\d+))?)\\b",
        "description": "Matching Geo-Coordinates like: 51.498134, -0.201755"
      },
      {
        "regex_id": "CanadianSIN",
        "pattern": "\\b(\\d{3}[\\s]\\d{3}[\\s]+\\d{3})\\b|\\b(\\d{3}[-]\\d{3}[-]+\\d{3})\\b",
        "description": "Matching Canadian Social Insurance Number like: 123-456-789"
      },
      {
        "regex_id": "CreditCardExpirationDate",
        "pattern": "\\b\\d{2}\\/\\d{2}\\b",
        "description": "Matching Credit Card Expiration Date like 11/12"
      },
      {
        "regex_id": "CVV-Number",
        "pattern": "\\b([0-9]{3,4})\\b",
        "description": "Matching Credit Card Verification Value number like: 670, 0927"
      },
      {
        "regex_id": "Currency",
        "pattern": "\\b(\\d+(\\.\\d{2})?)\\b",
        "description": "Matching currency like: 123, 25.50"
      }
    ]