Hello-
Your most recent example should work in that it will return VM's 12-24, but, it will not include _only_ 12-24. This example will match 1 or 2 on the first character after "vm", and zero through nine for the second character. So, putting that together, it would match vm10, vm11, vm12..., vm19, vm20, vm21..., vm27, vm28, and vm29 -- so, instead of vm12 through vm24, it matches vm10 through vm29.
Now, if you do not have any VMs with numbered names outside of 12 through 24, that would be why your example returned the same. But, for the day that someone creates vm11, and you do not really want to act on that with this [whatever is the purpose] code, you will want to tighten down those patterns. See how that is working?