Skip to content

Commit

Permalink
Change mod ID regex to allow '.' in mod IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Sep 15, 2024
1 parent a9958a7 commit a9969c4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
public class ModInfo implements IModInfo, IConfigurable {
private static final Logger LOGGER = LogUtils.getLogger();
private static final DefaultArtifactVersion DEFAULT_VERSION = new DefaultArtifactVersion("1");
private static final Pattern VALID_MODID = Pattern.compile("^[a-z][a-z0-9_]{1,63}$");
// Mod IDs must:
// - be from 2 to 64 characters long
// - contain only lowercase letters, digits, underscores, and periods, to satisfy both java module and resource location namespace requirements
// - each dot-separated section must start with a lowercase letter (they must be java identifiers)
private static final Pattern VALID_MODID = Pattern.compile("^(?=.{2,64}$)[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$");
private static final Pattern VALID_NAMESPACE = Pattern.compile("^[a-z][a-z0-9_.-]{1,63}$");
private static final Pattern VALID_VERSION = Pattern.compile("^\\d+.*");

Expand Down

0 comments on commit a9969c4

Please sign in to comment.