本帖最后由 fybhwsx 于 2020-5-3 11:17 编辑
我测试查找系统带唤醒计算机的任务计划,着色不知道对不对,我觉得要是在找到的结果“true”与正则那对儿小括号颜色一致(或者在随便弄个颜色与整段或整行区分一下)最好。我不懂啊,只是瞎说哈。我最期待的还是A版能整合到Au3.REHelper中!
本来我正则这样写的:(?s)Windows.*?<WakeToRun>(.*?)< 但发现中间没用的段落也都着色了,明显我正则写的不对。。任务计划代码一部分:
<!-- \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical -->
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.6" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2010-09-30T14:53:37.9516706</Date>
<SecurityDescriptor>D:(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;OICI;GR;;;AU)(A;;FRFX;;;LS)</SecurityDescriptor>
<URI>\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical</URI>
</RegistrationInfo>
<Principals>
<Principal id="Author">
<UserId>S-1-5-18</UserId>
</Principal>
</Principals>
<Settings>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<Enabled>false</Enabled>
<ExecutionTimeLimit>PT2H</ExecutionTimeLimit>
<Hidden>true</Hidden>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<WakeToRun>true</WakeToRun>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
<MaintenanceSettings>
<Period>P1D</Period>
<Deadline>P2D</Deadline>
</MaintenanceSettings>
</Settings>
<Triggers>
<IdleTrigger />
</Triggers>
<Actions Context="Author">
<ComHandler>
<ClassId>{613FBA38-A3DF-4AB8-9674-5604984A299A}</ClassId>
<Data><![CDATA[/RuntimeWide]]></Data>
</ComHandler>
</Actions>
</Task>
<!-- \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical -->
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.6" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2010-09-30T14:53:37.9516706</Date>
<SecurityDescriptor>D:(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;OICI;GR;;;AU)(A;;FRFX;;;LS)</SecurityDescriptor>
<URI>\Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical</URI>
</RegistrationInfo>
<Principals>
<Principal id="Author">
<UserId>S-1-5-18</UserId>
</Principal>
</Principals>
<Settings>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<Enabled>false</Enabled>
<ExecutionTimeLimit>PT2H</ExecutionTimeLimit>
<Hidden>true</Hidden>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<WakeToRun>true</WakeToRun>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
<MaintenanceSettings>
<Period>P1D</Period>
<Deadline>P2D</Deadline>
</MaintenanceSettings>
</Settings>
<Triggers>
<IdleTrigger />
</Triggers>
<Actions Context="Author">
<ComHandler>
<ClassId>{DE434264-8FE9-4C0B-A83B-89EBEEBFF78E}</ClassId>
<Data><![CDATA[/RuntimeWide]]></Data>
</ComHandler>
</Actions>
</Task>
<!-- \Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Automated) -->
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.6" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2006-11-10T14:29:55.5851926</Date>
<SecurityDescriptor>D:(A;;FA;;;BA)(A;;FA;;;SY)(A;;FRFX;;;WD)</SecurityDescriptor>
<Author>$(@%systemRoot%\System32\msdrm.dll,-6001)</Author>
<Description>$(@%systemRoot%\System32\msdrm.dll,-6002)</Description>
<URI>\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Automated)</URI>
</RegistrationInfo>
<Principals>
<Principal id="AllUsers">
<GroupId>S-1-1-0</GroupId>
</Principal>
</Principals>
<Settings>
<AllowHardTerminate>false</AllowHardTerminate>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<Enabled>false</Enabled>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<MultipleInstancesPolicy>Parallel</MultipleInstancesPolicy>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>true</RunOnlyIfNetworkAvailable>
<IdleSettings>
<Duration>PT10M</Duration>
<WaitTimeout>PT1H</WaitTimeout>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
</Settings>
<Triggers>
<CalendarTrigger id="7dba1862-fdda-4030-83de-895375c111d4">
<StartBoundary>2006-11-09T03:00:00</StartBoundary>
<RandomDelay>PT1H</RandomDelay>
<ScheduleByDay>
<DaysInterval>1</DaysInterval>
</ScheduleByDay>
</CalendarTrigger>
<LogonTrigger id="06b3f632-87ad-4ac0-9737-48ea5ddbaf11">
<Delay>PT1H</Delay>
</LogonTrigger>
</Triggers>
<Actions Context="AllUsers">
<ComHandler>
<ClassId>{CF2CF428-325B-48D3-8CA8-7633E36E5A32}</ClassId>
</ComHandler>
</Actions>
</Task>
<!-- \Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Manual) -->
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.6" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2006-11-10T14:29:55.5851926</Date>
<SecurityDescriptor>D:(A;;FA;;;BA)(A;;FA;;;SY)(A;;FRFX;;;WD)</SecurityDescriptor>
<Author>$(@%systemRoot%\System32\msdrm.dll,-6001)</Author>
<Description>$(@%systemRoot%\System32\msdrm.dll,-6003)</Description>
<URI>\Microsoft\Windows\Active Directory Rights Management Services Client\AD RMS Rights Policy Template Management (Manual)</URI>
</RegistrationInfo>
<Principals>
<Principal id="AllUsers">
<GroupId>S-1-1-0</GroupId>
</Principal>
</Principals>
<Settings>
<AllowHardTerminate>false</AllowHardTerminate>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<MultipleInstancesPolicy>Parallel</MultipleInstancesPolicy>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>true</RunOnlyIfNetworkAvailable>
<IdleSettings>
<Duration>PT10M</Duration>
<WaitTimeout>PT1H</WaitTimeout>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
</Settings>
<Triggers>
<LogonTrigger id="06b3f632-87ad-4ac0-9737-48ea5ddbaf11">
<Enabled>false</Enabled>
<Delay>PT1H</Delay>
</LogonTrigger>
</Triggers>
<Actions Context="AllUsers">
<ComHandler>
<ClassId>{BF5CB148-7C77-4D8A-A53E-D81C70CF743C}</ClassId>
</ComHandler>
</Actions>
</Task>
<!-- \Microsoft\Windows\AppID\EDP Policy Manager -->
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.6" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2015-02-09T10:54:13.9629482</Date>
<SecurityDescriptor>D:P(A;;FA;;;BA)(A;;FA;;;SY)(A;;FA;;;S-1-5-87-2978287140-3787137133-1749738600-1988163579-2060695581)</SecurityDescriptor>
<Source>$(@%SystemRoot%\system32\ApplockerCsp.dll,-101)</Source>
<Author>$(@%SystemRoot%\system32\ApplockerCsp.dll,-100)</Author>
<Description>$(@%SystemRoot%\system32\ApplockerCsp.dll,-102)</Description>
<URI>\Microsoft\Windows\AppID\EDP Policy Manager</URI>
</RegistrationInfo>
<Principals>
<Principal id="LocalService">
<UserId>S-1-5-19</UserId>
</Principal>
</Principals>
<Settings>
<AllowHardTerminate>false</AllowHardTerminate>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
</Settings>
<Triggers>
<WnfStateChangeTrigger>
<StateName>7588BCA328009213</StateName>
</WnfStateChangeTrigger>
<WnfStateChangeTrigger>
<StateName>75E0BCA328009213</StateName>
</WnfStateChangeTrigger>
</Triggers>
<Actions Context="LocalService">
<ComHandler>
<ClassId>{DECA92E0-AF85-439E-9204-86679978DA08}</ClassId>
<Data><![CDATA[EdpPolicyManager]]></Data>
</ComHandler>
</Actions>
</Task>
正则:<WakeToRun>(.*)<
|