Skip to main content

Data & Intelligence

SPSS Does Regular Expressions

Well. OK, it does use Python, but you can use Python and regular expressions within IBM SPSS.  Regular expressions allow you to do complex string searches with a minimal amount of coding.  Both IBM SPSS Statistics and Modeler do a good job with string manipulation.  However, you often are faced with performing complex string searches and manipulations that can take multiple loops within Statistics or several Derive Nodes within Modeler.  Often, once you finally get the desired results, your code is not scalable or able to be productionalized.  Your code is specific only to your development data.   Splunk is an alternative, but that might be more horsepower than you need.  Regular expressions are a nice way to fill in the middle ground.  Here is a link to an example with addresses and other with zip codes.

I think regular expressions can be a huge time saver and make for better code.  They are only my radar this coming year to get more practice working with them.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow Us