because we are not striping the padding from the inbound variable this will match any string of more than 1 character even though it seems to imply an excepted length or three or more and not 2 or more.

In order to accept these cases with embeded spaces I would modify the expression to the following.

prxmatch('/^[A-Z0-9].{1,}$/',strip(id))

^[A-Z0-9] the start of the string is letter A-Z or digit 0-9

.{1,}$ followed by any character (except new line) 1 or more times

without the strip function on the inbound variable id the strings will be padded and match for length even though they may not be more that 1 character long.

data foo(where=(prxmatch('/^[A-Z0-9].{1,}$/',strip(id))));

infile cards truncover;

input @1 id $10.;

cards;

1234-A35

1234567-d45

e453768

1

A123

A 123

A 123

*123456789

*12345

;

run;

1234-A35

1234567-d4

A123

A 123

A 123

like previous to make the expression not case sensitive '/^[A-Z0-9].{1,}$/i' will capture the additional id e453768.