Regex to get the words after matching string

前端 未结 6 1049
予麋鹿
予麋鹿 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:13

    The following should work for you:

    [\n\r].*Object Name:\s*([^\n\r]*)
    

    Working example

    Your desired match will be in capture group 1.


    [\n\r][ \t]*Object Name:[ \t]*([^\n\r]*)
    

    Would be similar but not allow for things such as " blah Object Name: blah" and also make sure that not to capture the next line if there is no actual content after "Object Name:"

提交回复
热议问题