Retrieve text in HTML with powershell

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

In this html code :

4条回答
  •  执念已碎
    2021-01-13 17:47

    Actually, the HTML surrounding your file name is irrelevant here. You can extract the date just fine with the following regex (which doesn't even care whether you're extracting it from an e-mail an HTML page or a CSV file):

    (?<=/tmp/IP_PHONE_BACKUP-)[^.]+(?=\.zip)
    

    Quick test:

    PS> [regex]::Match($html, '(?<=/tmp/IP_PHONE_BACKUP-)[^.]+(?=\.zip)')
    
    Groups   : {2012-Jul-25_15:47:47}
    Success  : True
    Captures : {2012-Jul-25_15:47:47}
    Index    : 391
    Length   : 20
    Value    : 2012-Jul-25_15:47:47
    

提交回复
热议问题