question: public static String unescapeJsString ( CharSequence s ) { Matcher m = UNESCAPE_PATTERN . matcher ( s ) ; if ( ! m . find ( ) ) { return s . toString ( ) ; } StringBuffer sb = new StringBuffer ( s . length ( ) ) ; do { m . appendReplacement ( sb , "" ) ; String g ; char repl ; if ( null != ( g = m . group ( 1 ) ) ) { repl = ( char ) Integer . parseInt ( g , 16 ) ; } else if ( null != ( g = m . group ( 2 ) ) ) { repl = ( char ) Integer . parseInt ( g , 8 ) ; } else if ( null != ( g = m . group ( 3 ) ) ) { repl = ( char ) Integer . parseInt ( g , 16 ) ; } else { char ch = s . charAt ( m . start ( 4 ) ) ; switch ( ch ) { case 'b' : repl = '\b' ; break ; case 'r' : repl = '\r' ; break ; case 'n' : repl = '\n' ; break ; case 'f' : repl = '\f' ; break ; case 't' : repl = '\t' ; break ; case 'v' : repl = '' ; break ; case '\n' : continue ; default : repl = ch ; break ; } } sb . append ( repl ) ; } while ( m . find ( ) ) ; m . appendTail ( sb ) ; return sb . toString ( ) ; }
target:  Replaces javascript escape sequences with the code units they specify.