private static String replaceNumber(String s,Pattern numberPattern,int base,int skipFirst,int skipLast){
  Matcher m=numberPattern.matcher(s);
  int matchstart=0;
  while (m.find(matchstart)) {
    String n=m.group(2);
    s=s.replaceFirst(n,Long.toString(Long.parseLong(n.substring(skipFirst,n.length() - skipLast),base)));
    matchstart=m.end(2);
  }
  return s;
}

private static String replaceNumber ( String s , Pattern numberPattern , int base , int skipFirst , int skipLast ) { Matcher m = numberPattern . matcher ( s ) ; int matchstart = 0 ; while ( m . find ( matchstart ) ) { String n = m . group ( 2 ) ; s = s . replaceFirst ( n , Long . toString ( Long . parseLong ( n . substring ( skipFirst , n . length ( ) - skipLast ) , base ) ) ) ; matchstart = m . end ( 2 ) ; } return s ; }
an internal helper function for hex2dec ( ) , replaces a given type of numbers inside the passed string
