In reply to Anton Meshcheryakov.

Hi Anton,
I am not quite sure I understand what you mean by "but it does not scale that nicely if there are a number of possible leading characters". Did you miss the Conclusion section where I mentioned that this technique "can simultaneously remove a variety of leading characters"? In addition, using various modifiers for the FINDC() function allows for specifying many characters in bulk, without listing them one by one. For example, we may augment a list of characters being removed by adding 'D' modifier: P = findc(X,C,'KD') which will remove all DIGITS in addition to those characters specified in C. Or 'L' modifier which adds all lowercase letters to the list of characters, and so on.

As for regular expressions, see my reply to a similar comment by Tom Sabo (2nd from the bottom). Yes, you can use regex in SAS by means of the PRX functions (there are always multiple ways of solving a problem), however be ready to pay a price of performance degradation compared to using native SAS functions (such as FINDC). This may not be an issue when processing small amounts of data, but it becomes a substantial factor when processing large data volumes.