static private boolean isNoncapturingParen(String s, int pos) {

        //int len = s.length();
        boolean isLookbehind = false;

        // code-coverage reports show that pos and the text to
        // check never exceed len in this class, so it's safe
        // to not test for it, which resolves uncovered branches
        // in Cobertura

        /*if (pos >= 0 && pos + 4 < len)*/ {
            String pre = s.substring(pos, pos+4);
            isLookbehind = pre.equals("(?<=") || pre.equals("(?<!");
        }
        return /*(pos >= 0 && pos + 2 < len) &&*/
               s.charAt(pos + 1) == '?' &&
               (isLookbehind || s.charAt(pos + 2) != '<');
    }
static private boolean isNoncapturingParen(String s, int pos) {

        
        boolean isLookbehind = false;

        
        
        
        

         {
            String pre = s.substring(pos, pos+4);
            isLookbehind = pre.equals("(?<=") || pre.equals("(?<!");
        }
        return 
               s.charAt(pos + 1) == '?' &&
               (isLookbehind || s.charAt(pos + 2) != '<');
    }
static private boolean isNoncapturingParen ( String s , int pos ) { //int len = s.length(); boolean isLookbehind = false ; // code-coverage reports show that pos and the text to // check never exceed len in this class, so it's safe // to not test for it, which resolves uncovered branches // in Cobertura /*if (pos >= 0 && pos + 4 < len)*/ { String pre = s . substring ( pos , pos + 4 ) ; isLookbehind = pre . equals ( "(?<=" ) || pre . equals ( "(?<!" ) ; } return /*(pos >= 0 && pos + 2 < len) &&*/ s . charAt ( pos + 1 ) == ' ' && ( isLookbehind || s . charAt ( pos + 2 ) != ' ' ) ; }
Determines if the parenthesis at the specified position
of a string is for a non-capturing group, which is one of
the flag specifiers (e.g., (?s) or (?m) or (?:pattern).
If the parenthesis is followed by "?", it must be a non-
capturing group unless it's a named group (which begins
with "?<"). Make sure not to confuse it with the lookbehind
construct ("?<=" or "?<!").

@param s string to evaluate
@param pos the position of the parenthesis to evaluate
@return true if the parenthesis is non-capturing; otherwise false
Determines if the parenthesis at the specified position of a string is for a non - capturing group which is one of the flag specifiers ( e . g . ( ?s ) or ( ?m ) or ( ? : pattern ) . If the parenthesis is followed by ? it must be a non - capturing group unless it s a named group ( which begins with ?< ) . Make sure not to confuse it with the lookbehind construct ( ?< = or ?<! ) .