public static boolean isIdentifier ( CharSequence s ) { int limit = s . length ( ) ; if ( limit == 0 ) { return false ; } int start = 0 ; do { if ( isSyntaxOrWhiteSpace ( s . charAt ( start ++ ) ) ) { return false ; } } while ( start < limit ) ; return true ; }
Tests whether the CharSequence contains a pattern identifier that is whether it contains only non - Pattern_White_Space non - Pattern_Syntax characters .