/* * testre.java * * Created on 1 de septiembre de 2003, 9:20 */ package ar.gov.mecon.sso.testing; import org.apache.regexp.*; /** * * @author fpscha * @version */ public class testre { /** Creates new testre */ public testre() { } static public String sanitize(String input) { String output= null; try { String allowed= "a-zA-Z0-9_@.: \u00F1\u00D1\u00E1\u00E9\u00ED\u00F3\u00FA\u00C1\u00C9\u00CD\u00D3\u00DA\r\n\\-"; RE r= new RE("[^"+allowed+"]"); output= r.subst(input, "_", RE.REPLACE_ALL); } catch (Exception ex) { ex.printStackTrace(); } return output; } /** * @param args the command line arguments */ public static void main (String args[]) { System.out.println(sanitize("a$.\u00F1JOla^|-+_")); } }