Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

Regexs not working for Command Cooldowns

Open Bobcat00 opened this issue 5 years ago • 2 comments

Information

Full output of /ess version:

Server version: 1.16.4-R0.1-SNAPSHOT git-Spigot-628435a-768d7fc (MC: 1.16.4)
EssentialsX version: 2.18.2.0
LuckPerms version: 5.2.35
Vault version: 1.7.3-b131
EssentialsXChat version: 2.18.2.0
EssentialsXGeoIP version: 2.18.2.0
EssentialsXSpawn version: 2.18.2.0

Server startup log:

[WARN] [Essentials] Command cooldown error: Unclosed group near index 14
^ban([^ip])?( 
[WARN] [Essentials] Command cooldown error: 'MemorySection[path='command-cooldowns.^^ban([^ip])?( ', root='EssentialsConf']' is not a valid cooldown
[WARN] [Essentials] Command cooldown error: Unclosed group near index 14
^ban([^ip])?( 
[WARN] [Essentials] Command cooldown error: 'MemorySection[path='command-cooldowns.^^ban([^ip])?( ', root='EssentialsConf']' is not a valid cooldown

EssentialsX config:

command-cooldowns:
  '^^ban([^ip])?( .*)?': 30

Details

Description:

EssentialsX produces multiple errors when attempting to use the example regex in the Command Cooldowns documentation at https://github.com/EssentialsX/Essentials/wiki/Command-Cooldowns . Any similar regex also results in errors. I can't get any regex ending with ( .)? to work.

Steps to reproduce:

Enter the regex from the documentation for highly technical users, as shown in the above config file excerpt.

Expected behavior:

I expected that EssentialsX would work with the regex given in the official EssentialsX documentation. (It's almost like nobody ever tested this.)

Bobcat00 avatar Dec 20 '20 23:12 Bobcat00

This is the case for all regular expressions that have a period in them. This is pending an implementation of #3200.

triagonal avatar Dec 21 '20 01:12 triagonal

My whole reason for going down the regex path was to have a unified cooldown for command aliases, which I see is being handled by #2058. So feel free to close this, or keep it open to keep track of the general regex bug and documentation.

Bobcat00 avatar Dec 21 '20 14:12 Bobcat00

Should be fixed in configurate when using quotes to encase the regex

JRoy avatar Jan 13 '23 02:01 JRoy