Java Code Conventions: must match pattern '^[a-z][a-zA-Z0-9]*$'
coding-style, java
Solution
^[a-z][a-zA-Z0-9]*$
This regex describes something which starts with lowercase and the remainder is composed of uppercase, lowercase, and numbers. (Examples: `aVariable`, `variable`, `aNewVariable`, `variable7`, `aNewVariable7`.)
If you want your field to be constant and static, use:
static final String ADD = "Add text";
Otherwise, use:
final String add = "Add text";
Problem
I would like to use the following constant: ``` final String ADD = "Add text"; ``` However, my CheckStyle tool tells me that 'ADD' does not match the pattern `'^[a-z][a-zA-Z0-9]*$'.` Could anyone please tell me what is wrong with 'ADD'? Means `'^[a-z][a-zA-Z0-9]*$'` that every name has to start with a low character? Is there no other possibility?