mirror of
https://github.com/plexusorg/ItemizerX.git
synced 2024-11-24 21:25:02 +00:00
Make the regex case insensitive
This commit is contained in:
parent
dfeaf2033d
commit
d806ad56f2
@ -980,11 +980,11 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
|
||||
|
||||
private Component colorize(String string)
|
||||
{
|
||||
Matcher matcher = Pattern.compile("&[a-fk-or0-9]").matcher(string);
|
||||
Matcher matcher = Pattern.compile("&[a-fk-or0-9]", Pattern.CASE_INSENSITIVE).matcher(string);
|
||||
while (matcher.find())
|
||||
{
|
||||
String color = matcher.group();
|
||||
string = string.replace(color, COLOR_TRANSLATION.getOrDefault(color, color));
|
||||
string = string.replace(color, COLOR_TRANSLATION.getOrDefault(color.toLowerCase(), color));
|
||||
}
|
||||
return mm.deserialize(string);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user