I'm making an word frequency program and I'm trying to process text to make it manageable. I'm trying to remove all special characters except $%^*+-=,./<> which are a part of a number. I have virtually no experience with regular expressions and after reading a bunch on it, I tried using the negative lookadead and negative lookaround to get something like
String replace = "[^a-z0-9\\\\s] | (?<!\\d)[$%^*+\\-=,./<>_] | [$%^*+\\-=,./<>_](?!\\d)";
text.replaceAll(replace, "");
In short I want "they're." to become "theyre" but I want "1223.444" to remain unchanged.