This regexp seems to work:
final String regexpStr = "\\[\"(.*?)\"\\]";
JUnit test for it:
@Test
public void regexp() {
final String[] noMatch = { "", "[", "[\"", "]", "\"]", "\"[", "]\"", "asdf",
"[\"asdfasdf\"", "asdf[sadf\"asdf\"]" };
final String[] match = { "[\"one\"]", "asdf[\"one\"]", "[\"one\"]asdf", "asdf[\"one\"]asdf",
"asdf[\"one\"]asdf[\"two\"]asdf" };
final String regexpStr = "\\[\"(.*?)\"\\]";
final Pattern pattern = Pattern.compile(regexpStr);
for (final String s : noMatch) {
final Matcher m = pattern.matcher(s);
Assert.assertFalse(m.matches());
}
for (final String s : match) {
final Matcher m = pattern.matcher(s);
Assert.assertTrue(m.find());
Assert.assertEquals(m.group(1), "one");
if (m.find()) {
Assert.assertEquals(m.group(1), "two");
}
}
}