#input: [domain]\[hostname]
(?P<name_domain>^[^\\/:*?\"<>|]*\w{1,63})\\(?P<name_root>[^\\/:*?\"<>|]*\w{1,63}$)
#Splunk rex:
| rex field=name "(?P<name_domain>^[^\\/:*?\"<>|]*\w{1,63})\\\(?P<name_root>[^\\/:*?\"<>|]*\w{1,63}$)"
https://www.vistax64.com/threads/locate-array-index-with-a-match-or-regex.269558/#post-1228092
$credstoreroot[ $($credstoreroot.hostname | select-string $regextomatch | foreach-object {$_.linenumber -1 }) ]