Created
March 4, 2018 02:14
-
-
Save m3hdiii/de45340f821d9528d928f3c0941a3fa1 to your computer and use it in GitHub Desktop.
Code For Regex Matching For all letters excepts symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
public static void main(String[] args) { | |
String textWithsymbols = "Th!s is For $ & NoT 4 Honey ... !@#$?<>%^&Y~*()_-=+aah جاوا فور اور"; | |
String s = textWithsymbols.replaceAll("[\\\\s\\\\d!\\\"#$%&\\'()*+,-./:;\\\\\\\\<>=?@\\\\^_`{}|~\\\\[\\\\]]",""); | |
System.out.println(s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment