Jump to content

Recommended Posts

Posted

The same as title.

i.e.How to use regexp at win-title?

not really you have to follow the regexp definition see StringRegExp flag=0 as the answer will be true or not.
Posted

Here is an example

Opt('WinTitleMatchMode', 4)
Opt('WinWaitDelay', 2000)
For $i = 1 To 10
    Switch Random(1, 3, 1)
        Case 1
            RunWait('explorer "' & @ProgramFilesDir & '"')
        Case 2
            RunWait('explorer "' & @WindowsDir & '"')
        Case 3
            RunWait('explorer "' & @SystemDir & '"')
    EndSwitch
    If Not WinWait('regexp=(?i)program files|windows|system32', '', 3) Then ExitLoop
    $title = WinGetTitle('regexp=(?i)program files|windows|system32')
    WinClose($title)
Next

and another here

http://www.autoitscript.com/forum/index.ph...st&p=293101

:)

Posted

not really you have to follow the regexp definition see StringRegExp flag=0 as the answer will be true or not.

I've tried some times,such as:

Opt("WinTitleMatchMode",4)
WinActivate("regexp=[a-Z ]");doesnot work
;WinActivate("regexp=([a-Z ])");doesnot work
;WinActivate("regexp=stringregexp("",[a-Z ])");doesnot work
;WinActivate("regexp=^Auto");doesnot work
WinActivate("AutoIt Help");works
;WinActivate("classname=HH Parent");works

how to write my regexp expressions in it?

Posted

Here is an example

Opt('WinTitleMatchMode', 4)
Opt('WinWaitDelay', 2000)
For $i = 1 To 10
    Switch Random(1, 3, 1)
        Case 1
            RunWait('explorer "' & @ProgramFilesDir & '"')
        Case 2
            RunWait('explorer "' & @WindowsDir & '"')
        Case 3
            RunWait('explorer "' & @SystemDir & '"')
    EndSwitch
    If Not WinWait('regexp=(?i)program files|windows|system32', '', 3) Then ExitLoop
    $title = WinGetTitle('regexp=(?i)program files|windows|system32')
    WinClose($title)
Next

and another here

http://www.autoitscript.com/forum/index.ph...st&p=293101

:)

thank you very much!!!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...