Hello All,

I am not really good at regex. How do I filter out only those strings with ALL UPPERCASE (strictly no lowercase, numbers are allowed)?

In this below example, i would like to filter only “GB8639NKH6”

Here is what I tried.

PS [22:54:27] D:\> $A = "GB8639NKH6","86232a62","VMware-56 4d 32 6a 30 ef 0b ff-59 ec fa 77 13 15 89 80" PS [22:54:59] D:\> $a GB8639NKH6 86232a62 VMware-56 4d 32 6a 30 ef 0b ff-59 ec fa 77 13 15 89 80 PS [22:55:02] D:\> $A | where {$_ -cmatch "[A-Z]"} GB8639NKH6 VMware-56 4d 32 6a 30 ef 0b ff-59 ec fa 77 13 15 89 80 PS [22:55:33] D:\> $A | where {$_ -cmatch "[^a-z]"} GB8639NKH6 86232a62 VMware-56 4d 32 6a 30 ef 0b ff-59 ec fa 77 13 15 89 80 PS [22:55:57] D:\> $A | where {$_ -cmatch "[^a-z]*"} GB8639NKH6 86232a62 VMware-56 4d 32 6a 30 ef 0b ff-59 ec fa 77 13 15 89 80 PS [22:56:09] D:\> $A | where {$_ -cmatch "[^a-z]*$"} GB8639NKH6 86232a62 VMware-56 4d 32 6a 30 ef 0b ff-59 ec fa 77 13 15 89 80 PS [22:57:25] D:\> $A | where {$_ -cmatch "[A-Z]*$"} GB8639NKH6 86232a62 VMware-56 4d 32 6a 30 ef 0b ff-59 ec fa 77 13 15 89 80