search cancel

How to filter values using Regular Expressions (RegEx) in Connector Express (CXP).


Article ID: 21105


Updated On:


CA Directory CA Identity Manager CA Identity Governance CA Identity Portal CA Risk Analytics CA Secure Cloud SaaS - Arcot A-OK (WebFort) CLOUDMINDER ADVANCED AUTHENTICATION CA Secure Cloud SaaS - Advanced Authentication CA Secure Cloud SaaS - Identity Management CA Secure Cloud SaaS - Single Sign On CA Security Command Center CA Data Protection (DataMinder) CA User Activity Reporting



At times, there may be a need to filter out unwanted characters or substrings from entered data or validate that data for formatting (e.g. phone number, SSN, etc.) before storing it. The Regular Expression processing has not yet been fully implemented in Connector Express.

Here is a workaround to implement regular expressions using the JCS override.


Use case:

You are creating a custom LDAP/JNDI endpoint and would like to filter-out any non-numeric characters from the telephone number entered by the user.

This will allow different clients connecting to that LDAP to format the data as per their needs without having to account for arbitrary formatting characters [e.g.: ( , - , + , etc.]


Support for RegEx conversion via connector metadata has not been fully implemented. Instead we recommended that you create a new flexi string type for any attributes that you want to convert and add the regex conversion via the connector type's override connector XML file..

First, define a new custom string type. For this use case, we create a "NumbersOnly" type.

<Please see attached file for image>

Figure 1

Edit the JCS_HOME\conf\override\jndi\connector.xml to add regex conversion for that string type.

A sample.connector.xml is provided for your convenience; you will need to copy it to a new file named connector.xml.

There is also a JDBC override folder if your use case is for JDBC. See the attached example for JDBC.

** Note that is appears that in 12.6 the sample.connector.xml file for JDBC is not being created. You will need to manually create a 'jdbc' subdirectory under JCS_HOME\conf\override and use the attached connector.xml as a starting point.

The new regex conversion section looks like this:

<!-- remove non digit characters from the string, e.g. formatting characters in phone numbers -->
<entry key="FLEXI_STR:numbersonly">
<bean class="">
<!-- style -->
<!-- regex -->

Restart the Java Connector Server for the changes to take effect.

In your connector, you will now define the relevant attribute (TelephoneNumber, in this case) as type "flexi - numbersonly".

<Please see attached file for image>

Figure 2

Save and deploy your connector as usual.


Release: CAPUEL99000-12.5-Identity Manager-Blended upgrade to Identity &-Access Mgmt Ente


1558703929282000021105_sktwi1f5rjvs16qc0.gif get_app
1558703922657000021105_sktwi1f5rjvs16qbz.gif get_app get_app