Dear SAS Community, I have a string variable in my data, which contains a mixture of different alphanumeric/special characters (really everything is possible). My task is to identify only special cases (=valid cases). Here is a minimal working example: Example Data: var1 Abc 123456 Abc 1234567 B aBc 123 A AbC 123 aBC 1243 123 abc 123 aBc123 Abc 12345 Abc 12345 abc 345 I only would like to find the highlighted cases, starting with three letters (upper or lower case possible) and followed by numbers (one is required, a max. of six is possible). Between the letters and the numbers one space is allowed but not required. I have tried for example the following code: DATA WORK.DATA_02; SET WORK.DATA_01; FOUND = 0; if PRXMATCH ("/^[Aa][Bb][Cc] ?[1-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?$/",var1) > 0 then FOUND = 1; RUN; Beside that I have also tried the code without the $ at the end, with different boundaries \b and hundreds of other combinations. Unfortunately nothing works... The strange thing is that it seems that the code ^([Aa][Bb][Cc]\ ?[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?)$ works in many online regex-checkers, but not within SAS. Can anybody help? Any hints, ideas or solutions? I am really desperately looking for an answer since days... Thank you very much in advance! Best regards Lars
... View more