diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterManager.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterManager.java index 14d9501..883428a 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterManager.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterManager.java @@ -140,10 +140,13 @@ public class LinkedBeaconTeleporterManager { String regex = serialiseBeaconItem(name, lore); // Wrap in regex-quotes - regex = "\\Q"+ regex +"\\E"; + regex = "^\\Q"+ regex +"\\E$"; // Exclude id from regex-quotes and create group regex = regex.replace("%id%", "\\E(.*)\\Q"); + // Remove empty regex-quotes + regex = regex.replace("\\E\\Q", ""); + return regex; } String serialiseBeaconItem(String name, List lore){