Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

[BUG] RegEx groups only uses matches #4

@wumbotivity

Description

@wumbotivity

Describe the bug
Lookahead (and lookbehind) functions do not work as expected with regex in chat filters. When used they don't match anything.

Minecraft Info

  • AdvancedChatFilters-1.0.0.jar

To Reproduce
Steps to reproduce the behavior:

  1. Make a new chat filter.
  2. Type 'test(?= test)' in the 'String to Find' field and set filter type to 'RegEx'.
  3. Type 'success' in the 'Replace to' field and set 'Replace Type' to 'Only Match'.
  4. Exit menu and write 'test test' in Minecraft chat.
  5. See error.

Expected behavior
The 'test test' string written in chat should be replaced with to 'success test', however it remains 'test test'.

Screenshots

Screenshot 2021-10-22 at 21 52 24

Screenshot 2021-10-22 at 21 52 43

Additional context
Mods used: Carpet, Voxel Map, Litematica, MaLiLib, MiniHUD, ModMenu, Optifabric, OptiFine, Fabric API, AdvancedChatCore, AdvancedChatFilters and AdvancedChatLog.

It does work as expected at regextester.com, so it shouldn't be a general regex bug.

Exported Chat Filter:

{"name":"foot","active":true,"stripColors":true,"findString":"testt(?\u003d test)","findType":"regex","replaceType":"onlymatch","replaceTo":"success","replaceTextColor":false,"textColor":"#FFFFFFFF","replaceBackgroundColor":false,"backgroundColor":"#FFFFFFFF","processors":{"forward":{"active":true},"actionbar":{"active":false},"sound":{"active":false,"notifySound":"none","soundPitch":1.0,"soundVolume":1.0},"narrator":{"active":false,"message":"$1"}},"order":0}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions