Fixed regex-generation

master
Ruakij 4 years ago
parent f8c7672cfa
commit 8889a16bdc

@ -140,10 +140,13 @@ public class LinkedBeaconTeleporterManager {
String regex = serialiseBeaconItem(name, lore); String regex = serialiseBeaconItem(name, lore);
// Wrap in regex-quotes // Wrap in regex-quotes
regex = "\\Q"+ regex +"\\E"; regex = "^\\Q"+ regex +"\\E$";
// Exclude id from regex-quotes and create group // Exclude id from regex-quotes and create group
regex = regex.replace("%id%", "\\E(.*)\\Q"); regex = regex.replace("%id%", "\\E(.*)\\Q");
// Remove empty regex-quotes
regex = regex.replace("\\E\\Q", "");
return regex; return regex;
} }
String serialiseBeaconItem(String name, List<String> lore){ String serialiseBeaconItem(String name, List<String> lore){

Loading…
Cancel
Save