DarkKronicle / AdvancedChatFilters

Advanced ways to filter and process Minecraft text
Mozilla Public License 2.0
8 stars 9 forks source link

[BUG] RegEx only uses the first match of a group when substituting #6

Closed SnazzGass closed 2 years ago

SnazzGass commented 2 years ago

Describe the bug when matching multiple sections with a single capture, only the first match gets substituted.

Minecraft Info Minecraft information:

To Reproduce enter (foo|bar) in string to find and set the mode to regex with replace match. This regex string should match and capture either "foo" or "bar", and substitute it into $1, resulting in "[foo]" or "[bar]" respectively image

type in chat "foo bar"

bruh moment image

Expected behavior

image

DarkKronicle commented 2 years ago

Thanks for the detailed report! I remember groups being weird so hopefully this is a simple fix.

DarkKronicle commented 2 years ago

Changed how RegEx filters work a bit. Can you check to see if this is fixed in the new update?

SnazzGass commented 2 years ago

I cant test if this fix worked because of the new bug https://github.com/DarkKronicle/AdvancedChatFilters/issues/8