Regex for Indian Voters ID or EPIC Number is not working as expected.
search cancel

Regex for Indian Voters ID or EPIC Number is not working as expected.

book

Article ID: 373486

calendar_today

Updated On:

Products

Data Loss Prevention Data Loss Prevention API Detection for Developer Apps Virtual Appliance Data Loss Prevention API Detection Virtual Appliance Data Loss Prevention Cloud Detection Service Data Loss Prevention Cloud Detection Service for ICAP Data Loss Prevention Cloud Detection Service for REST Data Loss Prevention Cloud Package Data Loss Prevention Cloud Prevent for Microsoft Office 365 Data Loss Prevention Cloud Service for Discovery/Connector Data Loss Prevention Cloud Service for Email Data Loss Prevention Cloud Storage Data Loss Prevention Data Access Governance Data Loss Prevention Discover Suite Data Loss Prevention Endpoint Discover Data Loss Prevention Endpoint Prevent Data Loss Prevention Endpoint Suite Data Loss Prevention Enforce Data Loss Prevention Enterprise Suite Data Loss Prevention for Office 365 Email and Gmail with Email Safeguard Data Loss Prevention Form Recognition Data Loss Prevention Network Discover Data Loss Prevention Network Email Data Loss Prevention Network Monitor Data Loss Prevention Network Monitor and Prevent for Email Data Loss Prevention Network Monitor and Prevent for Email and Web Data Loss Prevention Network Monitor and Prevent for Web Data Loss Prevention Network Prevent for Email Data Loss Prevention Network Prevent for Email Virtual Appliance Data Loss Prevention Network Prevent for Web Virtual Appliance Data Loss Prevention Network Protect Data Loss Prevention Network Web Data Loss Prevention Oracle Standard Edition 2 Data Loss Prevention Plus Suite Data Loss Prevention Sensitive Image Recognition

Issue/Introduction

A custom regex based detection rule for Indian voters id was created with the following conditions:

Mandatory :

  • ID is a unique alphanumeric code. combination of alphabets ( A to Z) and digits (0 to 9).
  • Its length should equal to 10.
  • ID starts with an alphabet and ends with a digit.
  • ID does not contain whitespaces and other special characters.

Optional conditions :

  • ID alphabets are Uppercase letters.
  • Keywords: Voter ID or Voters ID or EPIC Number.

The created regex is ^[A-Z]{3}[0-9]{7}$

Regular Expression tester sites like https://www.regextester.com/ and https://regex101.com/ suggest the regex is correct and matches the following samples: 

XGN3002623

NSC0307223

XGS1234567

Cause

The Symantec DLP does not process the $ sign in the regex at the end.

Resolution

Remove the $ sign so now the RegEx is this ^[A-Z]{3}[0-9]{7} and detection will work as expected. 

The samples mentioned above are detected successfully now.

Additional Information