Given the following string which may appear any number of times across various documents and in various different formats, I want to pull out the part between the quotes. I Only want strings which meet the following conditions. Starts and ends with ” (between two quotes) and has 1 or more dots (.) within the string.
@CheckWith(value = PasswordCheck.class, message = “validation.password.blah.foo”)
The following regex gives me the first three parts of the string validation.password.blah but misses the .foo
(\")([a-zA-Z]{1,}\.{1}){1,}
Try the following:
Note that instead of
{1,}you can usually use+, but I’m not sure if grep supports that without an extended option.Explanation: