Skip to main content
AllDevToolsHub
Back to all patterns

Java Package Name

Validation

Validates a Java package name (lowercase segments separated by dots).

/^(?:[a-z][a-z0-9_]*)(?:\.[a-z][a-z0-9_]*)+$/

How it works

Java packages are dot-separated, each segment lowercase letter-led. At least two segments are required (com.example, org.acme).

Test Cases

Should Match

  • com.example
  • org.springframework.boot
  • io.netty.handler

Should NOT Match

  • Com.Example
  • com
  • com..example

Quick Summary

Validates a Java package name (multiple lowercase dot-separated segments).