question: public void parseRulePatterns ( List < Pattern > patterns , String rulePatterStr ) { Pattern pattern = null ; String prefix = rulePatterStr . substring ( 0 , 2 ) ; int strLength = rulePatterStr . length ( ) ; switch ( prefix ) { case "%'" : pattern = getModPattern ( rulePatterStr , strLength ) ; break ; case "~%" : String rulePatterStrTemp = rulePatterStr . substring ( 1 ) ; int length = rulePatterStrTemp . length ( ) ; pattern = new NotPattern ( getModPattern ( rulePatterStrTemp , length ) ) ; break ; case "n'" : String rangeStr0 = rulePatterStr . substring ( 2 , strLength - 1 ) ; pattern = getRangePattern ( rangeStr0 ) ; break ; case "~n" : String rangeStr1 = rulePatterStr . substring ( 3 , strLength - 1 ) ; pattern = new NotPattern ( getRangePattern ( rangeStr1 ) ) ; break ; case "r'" : String methodName = rulePatterStr . substring ( 2 , strLength - 1 ) ; pattern = new RegexpPattern ( methodName ) ; break ; case "s'" : String callerFrom = rulePatterStr . substring ( 2 , strLength - 1 ) ; pattern = new StringPattern ( callerFrom ) ; break ; case "~s" : String notS = rulePatterStr . substring ( 3 , strLength - 1 ) ; pattern = new NotPattern ( new StringPattern ( notS ) ) ; break ; case "ip" : String ip = rulePatterStr . substring ( 3 , strLength - 1 ) ; pattern = extractIp ( ip ) ; break ; case "~i" : String notIp = rulePatterStr . substring ( 4 , strLength - 1 ) ; pattern = new NotPattern ( extractIp ( notIp ) ) ; break ; default : } patterns . add ( pattern ) ; }
target:  %'1024n+0..9' ~%'1024n+0..9' n'10' ~n'10..20' s"getSku" r"get.*" ip"1.2.3/24"