import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "(Â|â|Ã|\\||©|®|™)";
final String string = "Calcaneal Locking Plate â\n"
+ "Aspen Richard-Allan® Surgical Needle, Keith’s Abdominal Cutting, Straight 0.03 in x 2.244 in\n"
+ "Laborie T-DOC® Single Sensor Coudé Catheter, Coude Tip 7 Fr\n\n"
+ "Hydrocellular Foam Dressings SILICONE ADHESIVE | WITH BORDER | Sacral | GENTLE ADHESIVE | STERILE 7\" x 7\" Dressing 5\" x 5\" Pad \n\n"
+ "00612479126886 c1c1a9c5-39a6-4816-8577-256b35dd2908 New Published 1 2018-11-05 2018-10-05 NULL In Commercial Distribution McKesson 16-4063 NULL 023904428 MCKESSON MEDICAL-SURGICAL INC. 96 Gauze Bandage Roll NON-STERILE 6-PLY | 100% COTTON 3.4\" x 3.6 Yards false true false false false true true false false false false false true Labeling does not contain MRI Safety Information false false false false FULLDownload_Part95_Of_100_2020-04-01.xml 2020-04-01 Full GUDID load 2020-04-01T04:19:25 2020-04-03 12:46:39.6105233 9999-12-31 23:59:59.9999999";
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println("Full match: " + matcher.group(0));
for (int i = 1; i <= matcher.groupCount(); i++) {
System.out.println("Group " + i + ": " + matcher.group(i));
}
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html