views:

106

answers:

1

Hi Guys,
I need your help.
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=)

A: 

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)