AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Google regex

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Visioneer



Joined: 19 Nov 2007
Posts: 36

PostPosted: Wed Jul 23, 2008 11:06 pm    Post subject: Google regex Reply with quote

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
View user's profile Send private message
Superfraggle



Joined: 02 Nov 2004
Posts: 848
Location: London, UK

PostPosted: Wed Jul 23, 2008 11:21 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Wed Jul 23, 2008 11:59 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group