Possible to inverse regex?

Create issue
Issue #62 resolved
Former user created an issue

So, I'm asking this because I'm trying to find a way to, when having tagged something, exclude it from other tagging when I need to.


I'd like to tag a project I'm working on, where the title of all windows related to that project says "This is my really important project".

I'd also like to keep track on everything else that is not related to that project, so I can tell what I might be wasting time on.

My thought here is that if I tag up all the projects/areas I deem important to track, I'll more easily be able to tag up areas where I'm wasting time, say all web browsing (the browser is also used in instances of "This is my really important project").

Now, tagging "My really important project" is easy enough;

current window $title =~ /My really important project/ ==> tag ImportantProject

But what about expressing the inverse of this? I'd now like to know how much time I'm not spending on My really important project (and potentially expand this to exclude N projects/activities depending on my needs to adjust this over time).

I have found a regex that seems to be able to do this, but looking at the reports it's not working out;

current window $title =~ /^(.(?!(My really important project)))*$/ ==> tag WastedTime

Any tips on how to achieve this?

Comments (2)

  1. nomeata repo owner

    Yes, simply put ! before your condition:

    !(current window $title =~ /My really important project/) ==> tag WastedTime

    Or combine both:

    if (current window $title =~ /My really important project/) then tag ImportantProject else tag WastedTime
  2. Log in to comment