Retrieve text in HTML with powershell

前端 未结 4 942
感情败类
感情败类 2021-01-13 17:34

In this html code :

4条回答
  •  醉梦人生
    2021-01-13 17:47

    Without regex:

    $a = '
    Creating a new ZIP of IP Phone files from HTTP/PhoneBackup and HTTPS/PhoneBackup
     /tmp/IP_PHONE_BACKUP-2012-Jul-25_15:47:47.zip
    Reports Success
    Download the new ZIP of IP Phone files
    ' $a.Substring($a.IndexOf("IP_PHONE_BACKUP")+"IP_PHONE_BACKUP".length+1, $a.IndexOf(".zip")-$a.IndexOf("IP_PHONE_BACKUP")-"IP_PHONE_BACKUP".length-1)

    Substring gets you a part of the original string. The first parameter is the start position of the substring while the second part is the length of the desiered substring. So now all you have to do is to calculate the start and the length using a little IndexOf- and Length-magic.

提交回复
热议问题