| View previous topic :: View next topic |
| Author |
Message |
Visioneer
Joined: 19 Nov 2007 Posts: 36
|
Posted: Wed Jul 23, 2008 11:06 pm Post subject: Google regex |
|
|
Please help me make a regex for SetTitleMatchMode Regex.
It should match for example:
Google - Microsoft Internet Explorer
or
http://www.google.com - Google - Microsoft Internet Explorer
or more exactly:
TitleText%A_Space%-%A_Space%A string for IE name
or
some URL%A_Space%-%A_Space%TitleText%A_Space%-%A_Space%A string for IE name
I guess you could say that [URL] would always have "://" and that
[A string for IE name] would always be just after the last %A_Space%-%A_Space%
in the full (title) string to be matched against.
Please show the example as an IfWinActive, regex and something to
use with WinGetActiveTitle, TitleVar to get "Google" either way.
I guess that would be a RegExReplace().
Thanks |
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 848 Location: London, UK
|
Posted: Wed Jul 23, 2008 11:21 pm Post subject: |
|
|
Regex will by default match anywhere on a string so a reg ex to match Google - Microsoft Internet Explorer or http://www.google.com - Google - Microsoft Internet Explorer would be
| Code: |
Settitlematchmode,regex
Ifwinactive,Google - Microsoft Internet Explorer |
_________________ Steve F AKA Superfraggle
http://r.yuwie.com/superfraggle |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Wed Jul 23, 2008 11:59 pm Post subject: |
|
|
Settitlematchmode 2 would work just as well for that particular case.
Visioneer, I notice that you have posted this request many times in the forum asking the same question different ways. Please keep your topic together in one place. It is a waste of your fellow member's time to keep answering it over and over. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
|