Jump to content

Recommended Posts

Posted

I have several windows that I'm trying to deal with that have no title, no consistent text or much else to match on except for the class. But the class itself varies each time the application runs and has colons in it. For example one class is: "Afx:8:17e:6:10de" and the last four characters are different every time. Could someone please provide an example of how this could be done? The help entry "Window Titles and Text (Advanced)" has a link for REGEXPCLASS directing to StringRegExp which has no examples for matching windows, much less the syntax for matching a window class via this method. Thanks...

  • Moderators
Posted (edited)

DrLarch,

I would imagine this would work:

  Quote

("[REGEXPCLASS:(?i)Abx:8:17e:6:[a-z0-9]{4}")

M23

Edited by Melba23
Wrong bracket

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Thanks Melba & jguinch, I'll give that a shot. But regarding the colons, I read somewhere that they need to be doubled up in some cases, but guessing not in a regular expression?

  • Moderators
Posted

DrLarch,

Not according to my testing - the only characters that need to be "escaped" in a RegEx are:

\ . ^ $ | [ ( { * + ? #

and that involves a leading " \ ".

You may be thinking of the double brackets when you deal with POSIX classes as when they are used inside existing class brackets it leads to the following rather odd syntax:

[[:alnum:]]

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...