I want to get the number of properties defined in properties file in Java. For example, I have properties defined as below:
prop.job1=somevalue
prop.job2=somevalue
prop.job3=somevalue
Now I want to get the number of properties which match the pattern "prop.job" + *
You can write your own function
get all property names, and then simply iterate over the names, get each property name and compare it with your String using regex. This will also give the flexibility to change regex or matching string.
http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html