public boolean quotedString(char quote,TextProvider textProvider)        
    {
        clearLastToken(textProvider);
        clearLeadingSpaces(textProvider);
        mark(textProvider);
        if (m_debug)
			debug("testing "+quote,textProvider);

        if (getNextChar(textProvider) != quote)
        {
            reset(textProvider);
            return false;
        }
        char lastChar = 0;
        char c = 0;
        StringBuilder sb = new StringBuilder();
        while (true)
        {
            lastChar = c;
            c = getNextChar(textProvider);
			if (c == 0) {
		        unmark(textProvider);
				return false;
			}
            if (c == quote && lastChar != '\\') break;
            sb.append(c);
        }
        unmark(textProvider);
        String s = sb.toString().trim();
        if (s.length() == 0) return false;
        textProvider.setLastToken(s);
        debug(textProvider);
        return true;
    }
public boolean quotedString ( char quote , TextProvider textProvider ) { clearLastToken ( textProvider ) ; clearLeadingSpaces ( textProvider ) ; mark ( textProvider ) ; if ( m_debug ) debug ( "testing " + quote , textProvider ) ; if ( getNextChar ( textProvider ) != quote ) { reset ( textProvider ) ; return false ; } char lastChar = 0 ; char c = 0 ; StringBuilder sb = new StringBuilder ( ) ; while ( true ) { lastChar = c ; c = getNextChar ( textProvider ) ; if ( c == 0 ) { unmark ( textProvider ) ; return false ; } if ( c == quote && lastChar != '\\' ) break ; sb . append ( c ) ; } unmark ( textProvider ) ; String s = sb . toString ( ) . trim ( ) ; if ( s . length ( ) == 0 ) return false ; textProvider . setLastToken ( s ) ; debug ( textProvider ) ; return true ; }
Match a quoted string. The quotes have to be present but they
are removed from the result. Quotes inside the string can be
'quoted' using the '\' character eg \"
@param quote style
@param textProvider
@return true if matched