Output containing "+" symbol cannot construct regular expression

Hi,
I’m a user having no programming experience but tried constructing regular expression from Categorization. But having some hard time constructing regular expression.

Matching Criteria:
New tab - User - MicrosoftU+200B​ Edge

Reg Ex constructed by me:
[- MicrosoftU+200B Edge]+$

I need to match “- MicrosoftU+200B Edge” using a regular expression. When I load the above regular expression it matches most of the applications and window title which I did not expect.

Also the actual window title shown in ActivityWatch is “New tab - User - Microsoft​ Edge” when it is pasted as test string in regex101.com it changes to “New tab - User - Microsoft​U+200B Edge”.

Thanks in advance.

+ is a special character in regex, which you can escape with a backslash \+ or by putting in a character class [+]. You seem to have put the entire thing in a character class, which will match any character in the class.

Try this instead: - MicrosoftU[+]200B Edge$

Although, I’m curious where the U+200B is coming from in the first place?

1 Like

Part - 1

I copied the said text from ActivityWatch history
Screenshot (719)

When tested in regex101 it results as follows

Tried this too

And got this…

Now I’m using the expression New tab - User - Microsoft for every profile in the browser. If U+200B is not there ActivityWatch can easily grab window titles easily.

Part - 2
When I used my personal and work emails (and Instagram) in Normal and Incognito browsing but ActivityWatch is using colors under Browser => Browser name => Social media but it is categorized under Browser => Browser name => Incognito.

The Window title is Instagram - Incognito Browsing
I changed the categorization which is much more flexible to me. AW is also consuming when lot of items are not categorized requiring me to manually categorize every item😂