It is possible to improve the performance of the following through a regular expression, the code is functional, but I want to know if there is any way to select the possible dash that exist in the unicode to standardize my dash
Words:
48553−FS002
48553-FS002
48553 FS002
48553-FS002-ESD12
Java
String reference = "48553−FS002";
String separador = reference.replaceFirst ( "\\w+(\\W)?\\w+", "$1" );
if(!separator.equals ( " " )) {
reference = reference.replaceAll ( separator, "-" );
}
Or you could search for the unicode code, I was reading the following: dash, but i haven't managed to make it work Java Regex Unicode