private static String nextToken(final String value, final int pos, final char startChar, final char endChar) {
        if (value.length() <= pos + 2 || value.charAt(pos) != startChar) {
            return null;
        }

        final StringBuilder sb = new StringBuilder();
        for (int i = pos + 1; i < value.length(); i++) {
            final char c = value.charAt(i);
            if (c == endChar) {
                return sb.toString();
            } else if (c == '[' || c == ']' || c == '(' || c == ')') {
                // Unexpected token
                return null;
            } else {
                sb.append(c);
            }
        }
        return null;
    }
This class is used to detect table cell values that contain URL's to be turned into hyperlinks.
<p>
[:text](http://some-url/:id){:hyperlinkTarget}
stroom-core-client-widget/src/main/java/stroom/hyperlink/client/Hyperlink.java