protected String getUserSegmentName(String segment){
        Matcher m = USER_SEGMENT_PATTERN.matcher(segment);
        if(m.find()){
            String value = m.group(0);
            return value.substring(1, value.length() - 1); //I wish I knew  regexp better!
        }
        return null;
    }
protected String getUserSegmentName ( String segment ) { Matcher m = USER_SEGMENT_PATTERN . matcher ( segment ) ; if ( m . find ( ) ) { String value = m . group ( 0 ) ; return value . substring ( 1 , value . length ( ) - 1 ) ; } return null ; }
Extracts user segment name from route config. Returns null if no pattern match: {xxx}.

@param segment user segment, such as "{user_id}",  "{fav_color}", etc.
@return the name inside the braces, "user_id", "fav_color", etc.
Returns null if no pattern match: {xxx}.