Extract all data in between two double quotes

前端 未结 4 1075
再見小時候
再見小時候 2021-01-24 02:08

I\'m trying to use a powershell regex to pull version data from the AssemblyInfo.cs file. The regex below is my best attempt, however it only pulls the string [assembly:

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-24 02:43

    You also need to include the starting double quotes otherwise it would start capturing from the start until the first " is reached.

    $prog = [regex]::match($s, '"([^"]+)"').Groups[1].Value
                                ^
    

提交回复
热议问题