Here you can find the source of sanitizeForSemgrexName(String text)
public static String sanitizeForSemgrexName(String text)
//package com.java2s; public class Main { /**/*from w ww . j a va 2 s . c o m*/ * Sanitizes the given string into a Semgrex friendly name */ public static String sanitizeForSemgrexName(String text) { text = text.replaceAll("\\.", "_DOT_"); text = text.replaceAll("\\,", "_COMMA_"); text = text.replaceAll("\\\\", "_BSLASH_"); text = text.replaceAll("\\/", "_BSLASH_"); text = text.replaceAll("\\?", "_QUES_"); text = text.replaceAll("\\!", "_BANG_"); text = text.replaceAll("\\$", "_DOL_"); text = text.replaceAll("\\!", "_BANG_"); text = text.replaceAll("\\&", "_AMP_"); text = text.replaceAll("\\:", "_COL_"); text = text.replaceAll("\\;", "_SCOL_"); text = text.replaceAll("\\#", "_PND_"); text = text.replaceAll("\\@", "_AND_"); text = text.replaceAll("\\%", "_PER_"); text = text.replaceAll("\\(", "_LRB_"); text = text.replaceAll("\\)", "_RRB_"); return text; } }