Skip navigation

Log In

Forgot your password?
Don’t have an account? Sign Up

Sign Up

Access our rich network of apps, trials, and services.

Start the registration process by entering your email address below.

Already have an account? Log In

Mapping: Split First and Last Name using RegEx

Free download

Posted by: Mohan Ganeshan

This sample mapping uses REG_EXTRACT function to split Employee name in to First Name, Middle Name and Last Name despite having data anomaly.

Overview


Regular expressions provide the foundation for describing or matching data according to defined syntax rules. A regular expression is nothing more than a pattern of characters itself, matched against a certain parcel of text.

 

Using Regular Expressions, it is simple to search for a specific word or string of characters. Almost every editor on every computer system can do this. Regular expressions are more powerful and flexible. You can search for words of a certain size. You can search Numbers, punctuation characters, patterns and so on.

 

At the same time, Regular expression can be very confusing and tricky.  The learning curve for Regular expression may not be very easy for everyone. Often this results in to underutilization of Regular Expression and true power is not harnessed.

 

The download file available here exemplifies the power of Regular Expression. It uses REG_EXTRACT function to extract first name, middle name and last name from a complete employee name. The input data poses following challenges.

 

  • The middle name may not be present.
  • There could multiple whitespaces between first name, middle name and last name.

 

Download file also contains a detailed PowerPoint presentation describing functionality and parameters of Regular Expression functions.

 

You can download this listing as part of the Bundle : Regular Expression.

Specifications

  • PowerCenter version 9.1 and 9.5

Resources

Comments Comments (3)

Related