Maybe my reasoning is faulty, but I can\'t get this working.
Here\'s my regex: (Device\\s#\\d(\\n.*)*?(?=\\n\\s*Device\\s#|\\Z))
(Device\\s#\\d(\\n.*)*?(?=\\n\\s*Device\\s#|\\Z))
Try it: http://
try this variant:
[regex]::Matches($data,'(?im)device #\d((?!\s*Device #\d)\r?\n.)*?') | select value Value ----- Device #0 Device #1 Device #2 Device #3 Device #4