Regular Expressions 101

Community Patterns

Android Package Validation - Java Regex

1

Regular Expression
Java 8

"
^([a-z0-9_]+\.[a-z0-9_]+)+$
"
g

Description

Note: replace the "." with "\." if you paste this on your java.

The regex will match if the package name is valid. example: my.new.hello.world.app

Supports: a-z 0-9 and underscore Supports multiple dots

Submitted by dlv_dls2 - 2 years ago