How to get all computer names that end in a zero?

I need to get a list of computers that just have either a zero or a 1 at the end of its name.

The computer names are alphanumeric.

For instance, let’s say that I have a list and I have a variable that contains the list of computer names that I will call $TotalDevices.

Here is what I did and it is working for most systems that have names like C90123, it’s fine, but with names like Test-Win10-X64, it does not seem to work so well because it breaks up the name and puts portions of it on separate lines possible because of the hyphens, but I am not certain:

[regex]::Matches($TotalDevices, ‘\D+\d+’).value

$TotalDevices = @('C90120','D90123','E90121','F90122')
$TotalDevices | foreach {
    if ($_.EndsWith(0) -or $_.EndsWith(1)) {
        "here you go $_"

Well, FML!

Thanks that worked.