FelixKratz / SbarLua

A Lua API for SketchyBar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confusing regex rule

roycefanproxy opened this issue · comments

It seems like the regex pattern applicable for sketchybar lua api is bash style, but somehow grouping doesn't work.
Example:
I have a few items with name patterns as below:

  1. space.
  2. space.padding.

but when I tried to set their property at once via regex pattern as /^space\\.(padding\\.)?[1-6]$/, I couldn't match any.

However, if I set the property separately with 2 different patterns: /^space\\.[1-6]$/ & /^space\\.padding\\.[1-6]$/, they worked.

Is it a bug or it's just my regex pattern mistake?