开发者

Find lines matching regex and select a different part of the line

开发者 https://www.devze.com 2023-01-02 07:56 出处:网络
I have two lines like below: /pace =builtin\\administratorsType=0x0 Flags=0x13 AccessMask=0x1f01ff /pace =domain\\userType=0x0 Flags=0x13 AccessMask=0x1f01ff

I have two lines like below:

/pace =builtin\administrators Type=0x0 Flags=0x13 AccessMask=0x1f01ff

/pace =domain\user Type=0x0 Flags=0x13 AccessMask=0x1f01ff

Need to create a regular expression where it only select 0x1f01ff where the line have domain\user.

This is what I have created but it select /pace =domain\user Type=0x0 Flags=0x13 AccessMask=:

^(.+domain(.*开发者_开发问答)accessmask=)


try this:

^.+domain\\user.+AccessMask=([^\s]+)

It matches any line that has domain\user and then get the value of accessmask (any character that is not a whitespace)

0

精彩评论

暂无评论...
验证码 换一张
取 消