Help with regex

Hi, I was just wondering whether you could help me with my regex query.

I have a few lectures and worksheets that have window names like “L{digit}-complete.mp4” or “tutorial{digit}{maybe underscore}solutions”, so I made the regex queries “L\d-complete\.mp4” and “tutorial\w+solutions” respectively.

However they’re still showing as uncategorised.

Thanks so much for ActivityWatch by the way

So I tried some other categories, and it seems it’s actually an issue with the backslashes being escaped.

e.g. yoahere won’t match yo\where (\w is a-z, A-Z, 0-9, _), but yo\where specifically will match it (doesn’t recognise the \w metacharacter).

So I was trying to use Firefox/Chrome DevTools and looking through the web-ui source, but I can’t manage to find where the RegEx test happens.

Could someone point me to the right file?

The regex matching is not done in the browser because it’s too slow to send all events generated in a week/month/year over HTTP to the browser. The categorization is done in aw-server/aw-server-rust through our query API/language. Look at what requests are made in the browser and you’ll see the query body containing the categorization rules.

Might be something wrong with that we need to escape the match the category regexes or something.

There is indeed something wrong with the escaping of backslashes, when i set my regex to ActivityW\wtch|aw- it becomes ActivityW\\\\wtch|aw- while to work it should be ActivityWatch\\wtch|aw- to work properly.

So I found the line where it escapes the categories, but I’m running into issues trying to npm run serve because I don’t know how to install aw-client so that it won’t say it’s missing.

If you mean aw-client-js for aw-webui it’s a git submodule, can be fetched by doing the following

git submodule update --init --recursive