Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { /** * Correct some OCR errors in argument where only numbers are expected. */ private static String fixOcrLettersToNums(String src) { return src.replace("S", "5").replace("s", "5").replace("O", "0").replace("B", "8").replace("o", "0") .replace("l", "1").replace("I", "1").replace("i", "1").replace("Z", "2").replaceAll("[^0-9]", ""); } }