Extracting specific data from a string with regex and Powershell

后端 未结 2 383
独厮守ぢ
独厮守ぢ 2020-12-10 02:02

I want to extract from this string

blocked-process-report process id=\"process435d948\" taskpriority=\"0\" logused=\"0\" waitresource=\"RID: 7:1:

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 02:53

    Save that as, say $string.

    Then do

    $string -match 'spid="(\d+)"'
    

    If there is a match, the value you want will be in $matches[1]

提交回复
热议问题