Regex to get the words after matching string

前端 未结 6 1052
予麋鹿
予麋鹿 2020-11-27 02:33

Below is the content:

Subject:
    Security ID:        S-1-5-21-3368353891-1012177287-890106238-22451
    Account Name:       ChamaraKer
    Account Domain:          


        
6条回答
  •  天命终不由人
    2020-11-27 03:14

    But I need the match result to be ... not in a match group...

    For what you are trying to do, this should work. \K resets the starting point of the match.

    \bObject Name:\s+\K\S+
    

    You can do the same for getting your Security ID matches.

    \bSecurity ID:\s+\K\S+
    

提交回复
热议问题